Mercurial > public > mercurial-scm > hg-stable
diff mercurial/commands.py @ 4179:7e1c8a565a4f
Move branch read/write to dirstate where it belongs
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Tue, 13 Mar 2007 18:50:02 -0500 |
parents | f9bbcebcacea |
children | dbc3846c09a1 3be4785f8994 |
line wrap: on
line diff
--- 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