comparison mercurial/commands.py @ 4207: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
comparison
equal deleted inserted replaced
4206:0b48e3985765 4207:7e1c8a565a4f
253 253
254 With <name>, set the current branch name. Otherwise, show the 254 With <name>, set the current branch name. Otherwise, show the
255 current branch name. 255 current branch name.
256 """ 256 """
257 257
258 if label is not None: 258 if label:
259 repo.opener("branch", "w").write(util.fromlocal(label) + '\n') 259 repo.dirstate.setbranch(util.fromlocal(label))
260 else: 260 else:
261 b = util.tolocal(repo.workingctx().branch()) 261 ui.write("%s\n" % util.tolocal(repo.dirstate.branch()))
262 if b:
263 ui.write("%s\n" % b)
264 262
265 def branches(ui, repo): 263 def branches(ui, repo):
266 """list repository named branches 264 """list repository named branches
267 265
268 List the repository's named branches. 266 List the repository's named branches.