mercurial/hg.py
changeset 3441 ef2e990f9047
parent 3431 145a8fde69e6
child 3448 6ca49c5fe268
equal deleted inserted replaced
3440:0f1fd9854cdc 3441:ef2e990f9047
   219 
   219 
   220 def update(repo, node):
   220 def update(repo, node):
   221     """update the working directory to node, merging linear changes"""
   221     """update the working directory to node, merging linear changes"""
   222     stats = _merge.update(repo, node, False, False, None, None)
   222     stats = _merge.update(repo, node, False, False, None, None)
   223     _showstats(repo, stats)
   223     _showstats(repo, stats)
   224     branch = repo.changectx(node).branch()
       
   225     repo.opener("branch", "w").write(branch + "\n")
       
   226     if stats[3]:
   224     if stats[3]:
   227         repo.ui.status(_("There are unresolved merges with"
   225         repo.ui.status(_("There are unresolved merges with"
   228                          " locally modified files.\n"))
   226                          " locally modified files.\n"))
   229     return stats[3]
   227     return stats[3]
   230 
   228 
   231 def clean(repo, node, wlock=None, show_stats=True):
   229 def clean(repo, node, wlock=None, show_stats=True):
   232     """forcibly switch the working directory to node, clobbering changes"""
   230     """forcibly switch the working directory to node, clobbering changes"""
   233     stats = _merge.update(repo, node, False, True, None, wlock)
   231     stats = _merge.update(repo, node, False, True, None, wlock)
   234     branch = repo.changectx(node).branch()
       
   235     repo.opener("branch", "w").write(branch + "\n")
       
   236     if show_stats: _showstats(repo, stats)
   232     if show_stats: _showstats(repo, stats)
   237     return stats[3]
   233     return stats[3]
   238 
   234 
   239 def merge(repo, node, force=None, remind=True, wlock=None):
   235 def merge(repo, node, force=None, remind=True, wlock=None):
   240     """branch merge with node, resolving changes"""
   236     """branch merge with node, resolving changes"""