Mercurial > public > mercurial-scm > hg
comparison mercurial/hg.py @ 6518:92ccccb55ba3
resolve: new command
- add basic resolve command functionality
- point failed update and merge at resolve
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Fri, 11 Apr 2008 12:52:56 -0500 |
parents | 0750f11152fe |
children | 23ef198efce9 |
comparison
equal
deleted
inserted
replaced
6517:fcfb6a0a0a84 | 6518:92ccccb55ba3 |
---|---|
269 """update the working directory to node, merging linear changes""" | 269 """update the working directory to node, merging linear changes""" |
270 pl = repo.parents() | 270 pl = repo.parents() |
271 stats = _merge.update(repo, node, False, False, None) | 271 stats = _merge.update(repo, node, False, False, None) |
272 _showstats(repo, stats) | 272 _showstats(repo, stats) |
273 if stats[3]: | 273 if stats[3]: |
274 repo.ui.status(_("There are unresolved merges with" | 274 repo.ui.status(_("use 'hg resolve' to retry unresolved file merges\n")) |
275 " locally modified files.\n")) | |
276 if stats[1]: | |
277 repo.ui.status(_("You can finish the partial merge using:\n")) | |
278 else: | |
279 repo.ui.status(_("You can redo the full merge using:\n")) | |
280 # len(pl)==1, otherwise _merge.update() would have raised util.Abort: | |
281 repo.ui.status(_(" hg update %s\n hg update %s\n") | |
282 % (pl[0].rev(), repo.changectx(node).rev())) | |
283 return stats[3] > 0 | 275 return stats[3] > 0 |
284 | 276 |
285 def clean(repo, node, show_stats=True): | 277 def clean(repo, node, show_stats=True): |
286 """forcibly switch the working directory to node, clobbering changes""" | 278 """forcibly switch the working directory to node, clobbering changes""" |
287 stats = _merge.update(repo, node, False, True, None) | 279 stats = _merge.update(repo, node, False, True, None) |
292 """branch merge with node, resolving changes""" | 284 """branch merge with node, resolving changes""" |
293 stats = _merge.update(repo, node, True, force, False) | 285 stats = _merge.update(repo, node, True, force, False) |
294 _showstats(repo, stats) | 286 _showstats(repo, stats) |
295 if stats[3]: | 287 if stats[3]: |
296 pl = repo.parents() | 288 pl = repo.parents() |
297 repo.ui.status(_("There are unresolved merges," | 289 repo.ui.status(_("use 'hg resolve' to retry unresolved file merges\n")) |
298 " you can redo the full merge using:\n" | |
299 " hg update -C %s\n" | |
300 " hg merge %s\n") | |
301 % (pl[0].rev(), pl[1].rev())) | |
302 elif remind: | 290 elif remind: |
303 repo.ui.status(_("(branch merge, don't forget to commit)\n")) | 291 repo.ui.status(_("(branch merge, don't forget to commit)\n")) |
304 return stats[3] > 0 | 292 return stats[3] > 0 |
305 | 293 |
306 def revert(repo, node, choose): | 294 def revert(repo, node, choose): |