mercurial/commands.py
changeset 4207 7e1c8a565a4f
parent 4204 f9bbcebcacea
child 4209 dbc3846c09a1
child 4217 3be4785f8994
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.