Mercurial > hg > mercurial-crew-with-dirclash
comparison mercurial/hg.py @ 3431:145a8fde69e6
Update branch on checkout/update
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Tue, 17 Oct 2006 18:30:20 -0500 |
parents | 39fd6e82ea38 |
children | ef2e990f9047 |
comparison
equal
deleted
inserted
replaced
3430:9a6491770b04 | 3431:145a8fde69e6 |
---|---|
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") | |
224 if stats[3]: | 226 if stats[3]: |
225 repo.ui.status(_("There are unresolved merges with" | 227 repo.ui.status(_("There are unresolved merges with" |
226 " locally modified files.\n")) | 228 " locally modified files.\n")) |
227 return stats[3] | 229 return stats[3] |
228 | 230 |
229 def clean(repo, node, wlock=None, show_stats=True): | 231 def clean(repo, node, wlock=None, show_stats=True): |
230 """forcibly switch the working directory to node, clobbering changes""" | 232 """forcibly switch the working directory to node, clobbering changes""" |
231 stats = _merge.update(repo, node, False, True, None, wlock) | 233 stats = _merge.update(repo, node, False, True, None, wlock) |
234 branch = repo.changectx(node).branch() | |
235 repo.opener("branch", "w").write(branch + "\n") | |
232 if show_stats: _showstats(repo, stats) | 236 if show_stats: _showstats(repo, stats) |
233 return stats[3] | 237 return stats[3] |
234 | 238 |
235 def merge(repo, node, force=None, remind=True, wlock=None): | 239 def merge(repo, node, force=None, remind=True, wlock=None): |
236 """branch merge with node, resolving changes""" | 240 """branch merge with node, resolving changes""" |