--- a/mercurial/commands.py Tue Mar 13 15:47:55 2007 -0500
+++ b/mercurial/commands.py Tue Mar 13 18:50:02 2007 -0500
@@ -255,12 +255,10 @@
current branch name.
"""
- if label is not None:
- repo.opener("branch", "w").write(util.fromlocal(label) + '\n')
+ if label:
+ repo.dirstate.setbranch(util.fromlocal(label))
else:
- b = util.tolocal(repo.workingctx().branch())
- if b:
- ui.write("%s\n" % b)
+ ui.write("%s\n" % util.tolocal(repo.dirstate.branch()))
def branches(ui, repo):
"""list repository named branches