Notify the user that hg branch does not create a branch until commit
authorBrendan Cully <brendan@kublai.com>
Mon, 18 Jun 2007 10:44:43 -0700
changeset 4601 e69da61e467e
parent 4600 64c415d2553a
child 4602 d9d177ef748a
Notify the user that hg branch does not create a branch until commit
mercurial/commands.py
--- a/mercurial/commands.py	Sun Jun 17 20:09:35 2007 -0700
+++ b/mercurial/commands.py	Mon Jun 18 10:44:43 2007 -0700
@@ -219,8 +219,9 @@
 def branch(ui, repo, label=None, **opts):
     """set or show the current branch name
 
-    With <name>, set the current branch name. Otherwise, show the
-    current branch name.
+    With no argument, show the current branch name. With one argument,
+    set the working directory branch name (the branch does not exist in
+    the repository until the next commit).
 
     Unless --force is specified, branch will not let you set a
     branch name that shadows an existing branch.
@@ -232,6 +233,7 @@
                 raise util.Abort(_('a branch of the same name already exists'
                                    ' (use --force to override)'))
         repo.dirstate.setbranch(util.fromlocal(label))
+        ui.status(_('marked working directory as branch %s\n') % label)
     else:
         ui.write("%s\n" % util.tolocal(repo.dirstate.branch()))