Replace sphinx manpage with manual one.

If we upload source tarballs to PyPI instead of eggs, then the man
pages actually work. However, this means that the installer has to
run setup.py. Using sphinx, while slighly nicer from a dev
perspective, means we have to then require that people installing
git-review also install sphinx, which is a bit overkill given the
size of the man page.

This change, and a change to the release process of not uploading
eggs to PyPI should finall get git review --help to work.

Change-Id: I29b07667127a9ec5c241b7e1fc5a3960dd2a6b63
This commit is contained in:
Monty Taylor 2011-10-29 22:22:50 -04:00
parent 04397785df
commit 1b20aa2df3
4 changed files with 94 additions and 345 deletions

View File

@ -1,216 +0,0 @@
# -*- coding: utf-8 -*-
#
# git-review documentation build configuration file, created by
# sphinx-quickstart on Mon Jul 18 13:42:23 2011.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.
import sys, os, datetime
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#sys.path.insert(0, os.path.abspath('.'))
# -- General configuration -----------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
#needs_sphinx = '1.0'
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = []
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# The suffix of source filenames.
source_suffix = '.rst'
# The encoding of source files.
#source_encoding = 'utf-8-sig'
# The master toctree document.
master_doc = 'index'
# General information about the project.
project = u'git-review'
copyright = u'2011, OpenStack, LLC'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = "%d.%02d" % (datetime.datetime.now().year, datetime.datetime.now().month)
# The full version, including alpha/beta/rc tags.
release = "%d.%02d.%02d" % (datetime.datetime.now().year, datetime.datetime.now().month, datetime.datetime.now().day)
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#language = None
# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
#today = ''
# Else, today_fmt is used as the format for a strftime call.
#today_fmt = '%B %d, %Y'
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = []
# The reST default role (used for this markup: `text`) to use for all documents.
#default_role = None
# If true, '()' will be appended to :func: etc. cross-reference text.
#add_function_parentheses = True
# If true, the current module name will be prepended to all description
# unit titles (such as .. function::).
#add_module_names = True
# If true, sectionauthor and moduleauthor directives will be shown in the
# output. They are ignored by default.
#show_authors = False
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
# A list of ignored prefixes for module index sorting.
#modindex_common_prefix = []
# -- Options for HTML output ---------------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = 'default'
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#html_theme_options = {}
# Add any paths that contain custom themes here, relative to this directory.
#html_theme_path = []
# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
#html_title = None
# A shorter title for the navigation bar. Default is the same as html_title.
#html_short_title = None
# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
#html_logo = None
# The name of an image file (within the static path) to use as favicon of the
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
# pixels large.
#html_favicon = None
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
#html_last_updated_fmt = '%b %d, %Y'
# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
#html_use_smartypants = True
# Custom sidebar templates, maps document names to template names.
#html_sidebars = {}
# Additional templates that should be rendered to pages, maps page names to
# template names.
#html_additional_pages = {}
# If false, no module index is generated.
#html_domain_indices = True
# If false, no index is generated.
#html_use_index = True
# If true, the index is split into individual pages for each letter.
#html_split_index = False
# If true, links to the reST sources are added to the pages.
#html_show_sourcelink = True
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
#html_show_sphinx = True
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
#html_show_copyright = True
# If true, an OpenSearch description file will be output, and all pages will
# contain a <link> tag referring to it. The value of this option must be the
# base URL from which the finished HTML is served.
#html_use_opensearch = ''
# This is the file name suffix for HTML files (e.g. ".xhtml").
#html_file_suffix = None
# Output file base name for HTML help builder.
htmlhelp_basename = 'OpenStackCIdoc'
# -- Options for LaTeX output --------------------------------------------------
# The paper size ('letter' or 'a4').
#latex_paper_size = 'letter'
# The font size ('10pt', '11pt' or '12pt').
#latex_font_size = '10pt'
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
('index', 'OpenStackCI.tex', u'git-review Documentation',
u'OpenStack, LLC', 'manual'),
]
# The name of an image file (relative to this directory) to place at the top of
# the title page.
#latex_logo = None
# For "manual" documents, if this is true, then toplevel headings are parts,
# not chapters.
#latex_use_parts = False
# If true, show page references after internal links.
#latex_show_pagerefs = False
# If true, show URL addresses after external links.
#latex_show_urls = False
# Additional stuff for the LaTeX preamble.
#latex_preamble = ''
# Documents to append as an appendix to all manuals.
#latex_appendices = []
# If false, no module index is generated.
#latex_domain_indices = True
# -- Options for manual page output --------------------------------------------
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'git-review', u'Submit changes to Gerrit for review',
[u'OpenStack, LLC'], 1)
]

View File

@ -1,92 +0,0 @@
.. git-review documentation master file, created by
sphinx-quickstart on Sun Sep 25 09:00:23 2011.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
==========
git-review
==========
SYNOPSIS
--------
:program:`git-review` [:ref:`OPTIONS <git-review-options-label`] [*BRANCH*]
DESCRIPTION
-----------
:program:`git-review` automates and streamlines some of the tasks involve with
submitting local changes to a *Gerrit* server for review.
.. _git-review-options-label:
OPTIONS
-------
.. program:: git-review
.. option:: --topic, -t
Sets the target topic for this change on the gerrit server.
.. option:: --dry-run, -n
Don't actually perform any commands that have direct effects. Print them
instead.
.. option:: --no-rebase, -R
Do not automatically perform a rebase before submitting the change to
gerrit.
.. option:: --update, -R
Skip cached local copies and force updates from network resources.
.. options:: --download, -d
Download a change from gerrit into a branch for review. Takes a numeric
change id as an argument.
.. options:: --setup, -s
Just run through the repo setup commands and then exit before attempting
to submit anything.
.. option:: --verbose, -v
Turns on more verbose output.
.. option:: --help, -h
Print usage information and exit.
.. option:: --version
Print version information and exit.
PROJECT CONFIGURATION
---------------------
To use git-review with your project, it is recommended that you create
a file at the root of the repository called ".gitreview" and place
information about your gerrit installation in it. The format is::
[gerrit]
host=review.example.com
port=29418
project=project.git
MANUAL CONFIGURATION
--------------------
If there is no existing remote named "gerrit", and no ".gitreview"
file in the current repository, you may need to manually create a git
remote called "gerrit". To do so, execute a command like::
USERNAME=jsmith
PROJECT=foobar
git remote add gerrit ssh://$USERNAME@review.example.com:29418/$PROJECT.git
Set USERNAME to your gerrit username, and PROJECT to the project name
in gerrit.

93
git-review.1 Normal file
View File

@ -0,0 +1,93 @@
.TH "GIT-REVIEW" "1" "October 27, 2011" "2011.10" "git-review"
.SH NAME
git-review \- Submit changes to Gerrit for review
.
.nr rst2man-indent-level 0
.
.de1 rstReportMargin
\\$1 \\n[an-margin]
level \\n[rst2man-indent-level]
level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
-
\\n[rst2man-indent0]
\\n[rst2man-indent1]
\\n[rst2man-indent2]
..
.de1 INDENT
.\" .rstReportMargin pre:
. RS \\$1
. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
. nr rst2man-indent-level +1
.\" .rstReportMargin post:
..
.de UNINDENT
. RE
.\" indent \\n[an-margin]
.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
.nr rst2man-indent-level -1
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.\" Man page generated from reStructeredText.
.
.SH SYNOPSIS
.sp
\fBgit\-review\fP [\fIOPTIONS <git\-review\-options\-label\fP] [\fIBRANCH\fP]
.SH DESCRIPTION
.sp
\fBgit\-review\fP automates and streamlines some of the tasks involve with
submitting local changes to a \fIGerrit\fP server for review.
.SH OPTIONS
.INDENT 0.0
.TP
.B \-\-topic, \-t
.sp
Sets the target topic for this change on the gerrit server.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-dry\-run, \-n
.sp
Don\(aqt actually perform any commands that have direct effects. Print them
instead.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-no\-rebase, \-R
.sp
Do not automatically perform a rebase before submitting the change to
gerrit.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-update, \-R
.sp
Skip cached local copies and force updates from network resources.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-verbose, \-v
.sp
Turns on more verbose output.
.UNINDENT
.SH PROJECT CONFIGURATION
.sp
To use git\-review with your project, it is recommended that you create
a file at the root of the repository called ".gitreview" and place
information about your gerrit installation in it. The format is:
.sp
.nf
.ft C
[gerrit]
host=review.example.com
port=29418
project=project.git
.ft P
.fi
.SH AUTHOR
OpenStack, LLC
.SH COPYRIGHT
2011, OpenStack, LLC
.\" Generated by docutils manpage writer.
.\"
.

View File

@ -15,9 +15,6 @@
# limitations under the License.
from setuptools import setup
from distutils.command.build import build
from setuptools.command.bdist_egg import bdist_egg
import commands
# version comes from git-review.
savename = __name__
@ -25,38 +22,6 @@ __name__ = "not-main"
exec(open("git-review", "r"))
__name__ = savename
cmdclass = {}
try:
from sphinx.setup_command import BuildDoc
class local_build_sphinx(BuildDoc):
def run(self):
for builder in ['html', 'man']:
self.builder = builder
self.finalize_options()
BuildDoc.run(self)
cmdclass['build_sphinx'] = local_build_sphinx
except:
pass
class local_build(build):
def run(self):
build.run(self)
commands.getoutput("sphinx-build -b man -c doc doc/ build/sphinx/man")
cmdclass['build'] = local_build
class local_bdist_egg(bdist_egg):
def run(self):
commands.getoutput("sphinx-build -b man -c doc doc/ build/sphinx/man")
bdist_egg.run(self)
cmdclass['bdist_egg'] = local_bdist_egg
setup(
name='git-review',
version=version,
@ -68,6 +33,5 @@ setup(
author_email='openstack@lists.launchpad.net',
url='http://www.openstack.org',
scripts=['git-review'],
data_files=[('share/man/man1', ['build/sphinx/man/git-review.1'])],
cmdclass=cmdclass,
data_files=[('share/man/man1', ['git-review.1'])],
)