232 |
232 |
233 def _update(repo, node): return update(repo, node) |
233 def _update(repo, node): return update(repo, node) |
234 |
234 |
235 def update(repo, node): |
235 def update(repo, node): |
236 """update the working directory to node, merging linear changes""" |
236 """update the working directory to node, merging linear changes""" |
|
237 pl = repo.parents() |
237 stats = _merge.update(repo, node, False, False, None, None) |
238 stats = _merge.update(repo, node, False, False, None, None) |
238 _showstats(repo, stats) |
239 _showstats(repo, stats) |
239 if stats[3]: |
240 if stats[3]: |
240 repo.ui.status(_("There are unresolved merges with" |
241 repo.ui.status(_("There are unresolved merges with" |
241 " locally modified files.\n")) |
242 " locally modified files.\n")) |
|
243 if stats[1]: |
|
244 repo.ui.status(_("You can finish the partial merge using:\n")) |
|
245 else: |
|
246 repo.ui.status(_("You can redo the full merge using:\n")) |
|
247 # len(pl)==1, otherwise _merge.update() would have raised util.Abort: |
|
248 repo.ui.status(_(" hg update %s\n hg update %s\n") |
|
249 % (pl[0].rev(), repo.changectx(node).rev())) |
242 return stats[3] |
250 return stats[3] |
243 |
251 |
244 def clean(repo, node, wlock=None, show_stats=True): |
252 def clean(repo, node, wlock=None, show_stats=True): |
245 """forcibly switch the working directory to node, clobbering changes""" |
253 """forcibly switch the working directory to node, clobbering changes""" |
246 stats = _merge.update(repo, node, False, True, None, wlock) |
254 stats = _merge.update(repo, node, False, True, None, wlock) |