[PATCH] convert: use field list instead of option list in help

Erik Zielke ez at aragost.com
Thu Nov 4 08:16:13 CDT 2010


# HG changeset patch
# User Erik Zielke <ez at aragost.com>
# Date 1288876487 -3600
# Node ID 8cfee437b51e9f1692505386df3a6772a0ddd18e
# Parent  0e0a52bd58f941c00b2a1d57f23676fa486e58c3
convert: use field list instead of option list in help

Use field list instead of option list in convert help, because the
option list format used, with defaults and type of argument is not
supported by docutils.

diff -r 0e0a52bd58f9 -r 8cfee437b51e hgext/convert/__init__.py
--- a/hgext/convert/__init__.py	Thu Oct 21 16:04:34 2010 -0500
+++ b/hgext/convert/__init__.py	Thu Nov 04 14:14:47 2010 +0100
@@ -137,20 +137,27 @@
 
     Mercurial Source
     ''''''''''''''''
+    
+    For a mercurial source the following options can be set with `--config 
+    option=arg`
 
-    --config convert.hg.ignoreerrors=False    (boolean)
-        ignore integrity errors when reading. Use it to fix Mercurial
-        repositories with missing revlogs, by converting from and to
-        Mercurial.
-    --config convert.hg.saverev=False         (boolean)
-        store original revision ID in changeset (forces target IDs to
-        change)
-    --config convert.hg.startrev=0            (hg revision identifier)
-        convert start revision and its descendants
+    :convert.hg.ignoreerrors: ignore integrity
+        errors when reading. Use it to fix Mercurial repositories with
+        missing revlogs, by converting from and to Mercurial. It takes a 
+        boolean argument and defaults to False
+    :convert.hg.saverev: store original.
+        revision ID in changeset (forces target IDs to change). It takes and 
+        boolean argument and defaults to False.
+    :convert.hg.startrev: convert
+        start revision and its descendants. It takse a hg revision identifier
+        and defaults to 0,
 
     CVS Source
     ''''''''''
 
+    For a cvs source the following options can be set with `--config 
+    option=arg`
+
     CVS source will use a sandbox (i.e. a checked-out copy) from CVS
     to indicate the starting point of what will be converted. Direct
     access to the repository files is not needed, unless of course the
@@ -161,33 +168,28 @@
     converted, and that any directory reorganization in the CVS
     sandbox is ignored.
 
-    The options shown are the defaults.
-
-    --config convert.cvsps.cache=True         (boolean)
-        Set to False to disable remote log caching, for testing and
-        debugging purposes.
-    --config convert.cvsps.fuzz=60            (integer)
-        Specify the maximum time (in seconds) that is allowed between
-        commits with identical user and log message in a single
-        changeset. When very large files were checked in as part of a
-        changeset then the default may not be long enough.
-    --config convert.cvsps.mergeto='{{mergetobranch ([-\\w]+)}}'
-        Specify a regular expression to which commit log messages are
-        matched. If a match occurs, then the conversion process will
-        insert a dummy revision merging the branch on which this log
-        message occurs to the branch indicated in the regex.
-    --config convert.cvsps.mergefrom='{{mergefrombranch ([-\\w]+)}}'
-        Specify a regular expression to which commit log messages are
-        matched. If a match occurs, then the conversion process will
-        add the most recent revision on the branch indicated in the
-        regex as the second parent of the changeset.
-    --config hook.cvslog
-        Specify a Python function to be called at the end of gathering
-        the CVS log. The function is passed a list with the log entries,
-        and can modify the entries in-place, or add or delete them.
-    --config hook.cvschangesets
-        Specify a Python function to be called after the changesets
-        are calculated from the the CVS log. The function is passed
+    :convert.cvsps.cache: Set to False to disable
+        remote log caching, for testing and debugging purposes. Default is True
+    :convert.cvsps.fuzz: Specify the maximum
+        time (in seconds) that is allowed between commits with identical user
+        and log message in a single changeset. When very large files were
+        checked in as part of a changeset then the default may not be long
+        enough. The default is 60.
+    :convert.cvsps.mergeto: Specify a
+        regular expression to which commit log messages are matched. If a
+        match occurs, then the conversion process will insert a dummy
+        revision merging the branch on which this log message occurs to the
+        branch indicated in the regex. Default is ='{{mergetobranch ([-\\w]+)}}'
+    :convert.cvsps.mergefrom: Specify a
+        regular expression to which commit log messages are matched. If a
+        match occurs, then the conversion process will add the most recent
+        revision on the branch indicated in the regex as the second parent of
+        the changeset. Default is '{{mergefrombranch ([-\\w]+)}}'
+    :hook.cvslog: Specify a Python function to be called at the end of
+        gathering the CVS log. The function is passed a list with the log
+        entries, and can modify the entries in-place, or add or delete them.
+    :hook.cvschangesets: Specify a Python function to be called after the
+        changesets are calculated from the the CVS log. The function is passed
         a list with the changeset entries, and can modify the changesets
         in-place, or add or delete them.
 
@@ -209,20 +211,24 @@
     can be overridden with following options. Set them to paths
     relative to the source URL, or leave them blank to disable auto
     detection.
-
-    --config convert.svn.branches=branches    (directory name)
-        specify the directory containing branches
-    --config convert.svn.tags=tags            (directory name)
-        specify the directory containing tags
-    --config convert.svn.trunk=trunk          (directory name)
-        specify the name of the trunk branch
+    
+    For a subversion source the following options can be set with `--config 
+    option=arg`
+    
+    :convert.svn.branches: specify the directory
+        containing branches. The defaults is branches
+    :convert.svn.tags: specify the directory
+        containing tags. The default is tags.
+    :convert.svn.trunk: specify the name of
+        the trunk branch The defauls is trunk.
 
     Source history can be retrieved starting at a specific revision,
     instead of being integrally converted. Only single branch
     conversions are supported.
 
-    --config convert.svn.startrev=0           (svn revision number)
-        specify start Subversion revision.
+    :convert.svn.startrev: specify start
+        Subversion revision. The argument has to be a svn revision number, 
+        and the default is 0.
 
     Perforce Source
     '''''''''''''''
@@ -236,19 +242,30 @@
 
     It is possible to limit the amount of source history to be
     converted by specifying an initial Perforce revision.
-
-    --config convert.p4.startrev=0            (perforce changelist number)
-        specify initial Perforce revision.
+    
+    For a perforce source the following options can be set with `--config 
+    option=arg`
+    
+    :convert.p4.startrev=: specify
+        initial Perforce revision. The arugment has to be a (perforce changelist
+        number)
 
     Mercurial Destination
     '''''''''''''''''''''
 
-    --config convert.hg.clonebranches=False   (boolean)
-        dispatch source branches in separate clones.
-    --config convert.hg.tagsbranch=default    (branch name)
-        tag revisions branch name
-    --config convert.hg.usebranchnames=True   (boolean)
-        preserve branch names
+    For a mercurial destination the following options can be set with 
+    `--config option=arg`
+
+    :convert.hg.clonebranches: dispatch source
+        branches in separate clones. The argument has to be a boolean,
+        and defaults to False.
+
+    :convert.hg.tagsbranch: tag revisions
+       branch name. The argument is the branch name and the default is default.
+
+    :convert.hg.usebranchnames: preserve branch names. The arguments has to 
+       be a boolean and the default is True
+
 
     """
     return convcmd.convert(ui, src, dest, revmapfile, **opts)
diff -r 0e0a52bd58f9 -r 8cfee437b51e tests/test-convert.t
--- a/tests/test-convert.t	Thu Oct 21 16:04:34 2010 -0500
+++ b/tests/test-convert.t	Thu Nov 04 14:14:47 2010 +0100
@@ -123,20 +123,26 @@
       Mercurial Source
       ''''''''''''''''
   
-      --config convert.hg.ignoreerrors=False    (boolean)
-          ignore integrity errors when reading. Use it to fix Mercurial
-          repositories with missing revlogs, by converting from and to
-          Mercurial.
+      For a mercurial source the following options can be set with "--config
+      option=arg"
   
-      --config convert.hg.saverev=False         (boolean)
-          store original revision ID in changeset (forces target IDs to change)
-  
-      --config convert.hg.startrev=0            (hg revision identifier)
-          convert start revision and its descendants
+      convert.hg.ignoreerrors
+                  ignore integrity errors when reading. Use it to fix Mercurial
+                  repositories with missing revlogs, by converting from and to
+                  Mercurial. It takes a boolean argument and defaults to False
+      convert.hg.saverev
+                  store original. revision ID in changeset (forces target IDs to
+                  change). It takes and boolean argument and defaults to False.
+      convert.hg.startrev
+                  convert start revision and its descendants. It takse a hg
+                  revision identifier and defaults to 0,
   
       CVS Source
       ''''''''''
   
+      For a cvs source the following options can be set with "--config
+      option=arg"
+  
       CVS source will use a sandbox (i.e. a checked-out copy) from CVS to
       indicate the starting point of what will be converted. Direct access to
       the repository files is not needed, unless of course the repository is
@@ -146,40 +152,37 @@
       starting directory will be converted, and that any directory
       reorganization in the CVS sandbox is ignored.
   
-      The options shown are the defaults.
-  
-      --config convert.cvsps.cache=True         (boolean)
-          Set to False to disable remote log caching, for testing and debugging
-          purposes.
-  
-      --config convert.cvsps.fuzz=60            (integer)
-          Specify the maximum time (in seconds) that is allowed between commits
-          with identical user and log message in a single changeset. When very
-          large files were checked in as part of a changeset then the default
-          may not be long enough.
-  
-      --config convert.cvsps.mergeto='{{mergetobranch ([-\w]+)}}'
-          Specify a regular expression to which commit log messages are matched.
-          If a match occurs, then the conversion process will insert a dummy
-          revision merging the branch on which this log message occurs to the
-          branch indicated in the regex.
-  
-      --config convert.cvsps.mergefrom='{{mergefrombranch ([-\w]+)}}'
-          Specify a regular expression to which commit log messages are matched.
-          If a match occurs, then the conversion process will add the most
-          recent revision on the branch indicated in the regex as the second
-          parent of the changeset.
-  
-      --config hook.cvslog
-          Specify a Python function to be called at the end of gathering the CVS
-          log. The function is passed a list with the log entries, and can
-          modify the entries in-place, or add or delete them.
-  
-      --config hook.cvschangesets
-          Specify a Python function to be called after the changesets are
-          calculated from the the CVS log. The function is passed a list with
-          the changeset entries, and can modify the changesets in-place, or add
-          or delete them.
+      convert.cvsps.cache
+                  Set to False to disable remote log caching, for testing and
+                  debugging purposes. Default is True
+      convert.cvsps.fuzz
+                  Specify the maximum time (in seconds) that is allowed between
+                  commits with identical user and log message in a single
+                  changeset. When very large files were checked in as part of a
+                  changeset then the default may not be long enough. The default
+                  is 60.
+      convert.cvsps.mergeto
+                  Specify a regular expression to which commit log messages are
+                  matched. If a match occurs, then the conversion process will
+                  insert a dummy revision merging the branch on which this log
+                  message occurs to the branch indicated in the regex. Default
+                  is ='{{mergetobranch ([-\w]+)}}'
+      convert.cvsps.mergefrom
+                  Specify a regular expression to which commit log messages are
+                  matched. If a match occurs, then the conversion process will
+                  add the most recent revision on the branch indicated in the
+                  regex as the second parent of the changeset. Default is
+                  '{{mergefrombranch ([-\w]+)}}'
+      hook.cvslog
+                  Specify a Python function to be called at the end of gathering
+                  the CVS log. The function is passed a list with the log
+                  entries, and can modify the entries in-place, or add or delete
+                  them.
+      hook.cvschangesets
+                  Specify a Python function to be called after the changesets
+                  are calculated from the the CVS log. The function is passed a
+                  list with the changeset entries, and can modify the changesets
+                  in-place, or add or delete them.
   
       An additional "debugcvsps" Mercurial command allows the builtin changeset
       merging code to be run without doing a conversion. Its parameters and
@@ -199,21 +202,24 @@
       them to paths relative to the source URL, or leave them blank to disable
       auto detection.
   
-      --config convert.svn.branches=branches    (directory name)
-          specify the directory containing branches
+      For a subversion source the following options can be set with "--config
+      option=arg"
   
-      --config convert.svn.tags=tags            (directory name)
-          specify the directory containing tags
-  
-      --config convert.svn.trunk=trunk          (directory name)
-          specify the name of the trunk branch
+      convert.svn.branches
+                  specify the directory containing branches. The defaults is
+                  branches
+      convert.svn.tags
+                  specify the directory containing tags. The default is tags.
+      convert.svn.trunk
+                  specify the name of the trunk branch The defauls is trunk.
   
       Source history can be retrieved starting at a specific revision, instead
       of being integrally converted. Only single branch conversions are
       supported.
   
-      --config convert.svn.startrev=0           (svn revision number)
-          specify start Subversion revision.
+      convert.svn.startrev
+                  specify start Subversion revision. The argument has to be a
+                  svn revision number, and the default is 0.
   
       Perforce Source
       '''''''''''''''
@@ -227,20 +233,28 @@
       It is possible to limit the amount of source history to be converted by
       specifying an initial Perforce revision.
   
-      --config convert.p4.startrev=0            (perforce changelist number)
-          specify initial Perforce revision.
+      For a perforce source the following options can be set with "--config
+      option=arg"
+  
+      convert.p4.startrev=
+                  specify initial Perforce revision. The arugment has to be a
+                  (perforce changelist number)
   
       Mercurial Destination
       '''''''''''''''''''''
   
-      --config convert.hg.clonebranches=False   (boolean)
-          dispatch source branches in separate clones.
+      For a mercurial destination the following options can be set with "--
+      config option=arg"
   
-      --config convert.hg.tagsbranch=default    (branch name)
-          tag revisions branch name
-  
-      --config convert.hg.usebranchnames=True   (boolean)
-          preserve branch names
+      convert.hg.clonebranches
+                  dispatch source branches in separate clones. The argument has
+                  to be a boolean, and defaults to False.
+      convert.hg.tagsbranch
+                  tag revisions branch name. The argument is the branch name and
+                  the default is default.
+      convert.hg.usebranchnames
+                  preserve branch names. The arguments has to be a boolean and
+                  the default is True
   
   options:
   


More information about the Mercurial-devel mailing list