# HG changeset patch # User Brendan Cully # Date 1182188683 25200 # Node ID e69da61e467e9316a72c4f47074314f2d8f1d34a # Parent 64c415d2553ae5dc90b244f37ad6e5c3dad94ce8 Notify the user that hg branch does not create a branch until commit diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -219,8 +219,9 @@ def backout(ui, repo, node=None, rev=Non def branch(ui, repo, label=None, **opts): """set or show the current branch name - With , 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 @@ def branch(ui, repo, label=None, **opts) 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()))