Commits

Anonymous committed 673bb8d

ideal branch should be a named branch with a tip marker

Comments (0)

Files changed (2)

-Title: hg-ibranch extension
-Author: André Felipe Dias <andref.dias at gmail dot com>
-Status: Draft
-Type: Mercurial Extension
+:Title: hg-ibranch
+:Type: Mercurial Extension
+:Status: Draft
+:Author: André Felipe Dias <andref.dias at gmail dot com>
 
 .. topic:: Collaboration
 
 
 The original ``hg branch`` command is replaced by a new one with the following options::
 
-    hg branch [-d | -m NAME | [-r REV] [-b]] [NAME]
 
-    track a line of development with movable markers and audit trails
-
-        Branches are managed by pointers to certain revisions that move when committing,
-        leaving an audit trail behind. Branches can be renamed and deleted but these operations
-        actually change the internal pointers, maintaining the real branch id intact.
-
-        Branches are recommended to both short and long-term branches.
-
-        With no argument, show the current branch name. With one argument, set the
-        working directory branch name (the branch will not exist in the repository
-        until the next commit). Standard practice recommends that primary
-        development take place on the 'default' branch.
-
-        Use -r/--rev REV (where REV may be an existing branch name) to create a new branch from
-        a specific revision.
-
-        Use -b/--bookmark to create a new named head of an existing branch.
-
-        Use both -r/--rev REV and -b/--bookmark to create a new named head of an
-        existing branch from a specific revision
-
-        Use the command "hg update" to switch to an existing branch.
-
-    options:
-
-    -r, --rev REV       create a branch from revision REV
-    -d, --delete        delete a given branch name
-    -m, --rename NAME   rename a given branch name
-    -b, --bookmark      create a new named head to the current branch.
 
     use "hg -v help branch" to show more info
 @command('branch',
     [
         ('r', 'rev', None, _('create a branch from revision REV')),
-        ('b', 'bookmark', None, _('create a new named head to the current branch')),
         ('m', 'rename', None, _('rename a given branch name')),
         ('d', 'delete', None, _('delete a given branch name')),
-        ('i', 'branch-id', None _('show the branch-id')),
+        ('w', 'wake', None _('revive a dead branch with a new name')),
     ],
-    _('[ [-r REV] [-b] NAME | -m NAME | -d NAME | -i [NAME] ]')
+    _('[[-r REV | -m [OLD_NAME] | -d | -w BRANCH_ID ] NAME]')
 )
 def branch(ui, repo, **opts):
     """
-    The original ``hg branch`` command is replaced by a new one with the following options::
+    hg branch [[-r REV | -m [OLD_NAME] | -d | -w BRANCH_ID ] NAME]
 
-    hg branch
-    hg branch [-r REV] [-b] NAME
-    hg branch -m NAME
-    hg branch -d NAME
-    hg branch -i [NAME]
 
-    track a line of development with movable markers and a audit trail
+    track a line of development with one movable marker and an audit trail
 
-        A branch is a sequence of revisions that have the same branch id. Internally,
-        a single branch may have several named pointers to head revisions that move along
-        when committing, recording the branch's id in each changeset. Branches can be renamed
-        and deleted but these operations only change pointers' names, maintaining the real
-        branch id and its changeset history intact.
+    A branch is a sequence of revisions that share the same branch id. The tip of a branch
+    is pointed by a marker which also holds the branch name.
 
-        Branches are recommended to both short and long-term branches.
-        Standard practice recommends that primary development take place on the 'default' branch.
+    A branch can also be deleted but this only removes its tip's marker whereas the history
+    remains the same. Use the command :hg:`strip` to really remove a branch.
 
-        With no argument, show the current branch name. With one argument, set the
-        working directory branch name (the branch will not exist in the repository
-        until the next commit).
+    Branches are recommended to both short and long-term branches.
+    Standard practice recommends that primary development take place on the 'default' branch.
 
-        Use -r/--rev REV (where REV may be an existing branch name) to create a new branch from
-        a specific revision.
+    With no argument, show the current branch name. With only NAME as argument, set a
+    new branch (that will exist in the repository after the next commit).
 
-        Use -b/--bookmark to create a new named pointer to an existing branch.
+    Use the command "hg update" to switch to an existing branch.
 
-        Use both -r/--rev REV and -b/--bookmark to create a new named head of an
-        existing branch from a specific revision.
+    Use -r/--rev REV (where REV may be an existing branch name) to create a new branch from
+    a specific revision.
 
-        Use -i to show the branch id pointed by NAME. If no NAME is given, the current
-        branch id is shown.
+    Use -m/--rename to change branch's name. Note that the branch id remains the same. If
+    OLD_NAME is given, then this branch is renamed. Otherwise, the current branch is renamed.
 
-        Use the command :hg:`update` to switch to an existing branch.
+    Use -d/--delete to remove the branch's tip marker. Removing a branch's tip marker
+    doesn't remove the history of a branch. To do that, you should use :hg:`strip`.
+
+    Use -w/--wake to revive a dead branch. A new tip marker is created with a new name.
 
     options:
 
     -r, --rev REV       create a branch from revision REV
     -d, --delete        delete a given branch name
     -m, --rename NAME   rename a given branch name
-    -b, --bookmark      create a new named head to the current branch.
-    -i, --branch-id     show the branch id
+    -w, --wake BRANCH_ID NAME  wake a dead branch with a new name
 
     Returns 0 on success.
     """
     pass
 
 
-@command('branches', [])
+@command('branches', [('d', 'dead-branches', None,
+    _("list branches that don't have a tip marker")),]
+)
 def branches(ui, repo, **opts):
     """list repository branches
 
 
     Use the command :hg:`update` to switch to an existing branch.
 
+    options:
+
+    -d, --dead-branches list branches that don't have a tip marker
+
     Returns 0.
     """
     pass