[PATCH] rebase: improve help text

Greg Ward greg-hg at gerg.ca
Fri Mar 5 08:18:26 CST 2010


# HG changeset patch
# User Greg Ward <greg-hg at gerg.ca>
# Date 1267798647 18000
# Branch stable
# Node ID 47c8906100fa5a8f762448694b79b054e359a785
# Parent  8be69abcae7dd5151d72ab17d590bb970bd6ce1b
rebase: improve help text.
- add a paragraph about default dest/source changesets
- option help: say "changeset" not "revision"
- option help: explain -b/--base better
- clarify that -a/--abort and -c/--continue are different from the
  other options

diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -31,6 +31,14 @@
     history onto another. This can be useful for linearizing local
     changes relative to a master development tree.
 
+    If you don't specify a destination changeset (-d), rebase uses the
+    tipmost head of the current branch. If you don't specify a source (-s)
+    or base (-b) changeset, rebase uses the parent of the working
+    directory. Unlike ``merge``, then, ``rebase`` might do nothing if you
+    are at the latest head of a branch with two heads. You need to
+    explicitly specify source and/or destination (or ``update`` to the
+    other head, if it's the head of the branch that you want to rebase).
+
     If a rebase is interrupted to manually resolve a merge, it can be
     continued with --continue/-c or aborted with --abort/-a.
     """
@@ -494,9 +502,10 @@
 "rebase":
         (rebase,
         [
-        ('s', 'source', '', _('rebase from a given revision')),
-        ('b', 'base', '', _('rebase from the base of a given revision')),
-        ('d', 'dest', '', _('rebase onto a given revision')),
+        ('s', 'source', '', _('rebase from the specified changeset')),
+        ('b', 'base', '', _('rebase from the base of the specified changeset '
+                            '(up to greatest common ancestor of base and dest)')),
+        ('d', 'dest', '', _('rebase onto the specified changeset')),
         ('', 'collapse', False, _('collapse the rebased changesets')),
         ('', 'keep', False, _('keep original changesets')),
         ('', 'keepbranches', False, _('keep original branch names')),
@@ -505,6 +514,6 @@
         ('c', 'continue', False, _('continue an interrupted rebase')),
         ('a', 'abort', False, _('abort an interrupted rebase'))] +
          templateopts,
-        _('hg rebase [-s REV | -b REV] [-d REV] [--collapse] [--detach] '
-                        '[--keep] [--keepbranches] | [-c] | [-a]')),
+        _('hg rebase [-s REV | -b REV] [-d REV] [options]\n'
+          'hg rebase {-a|-c}'))
 }


More information about the Mercurial-devel mailing list