Mercurial > hg
comparison mercurial/hg.py @ 10651:5f091fc1bab7
style: use consistent variable names (*mod) with imports which would shadow
author | Benoit Boissinot <benoit.boissinot@ens-lyon.org> |
---|---|
date | Thu, 11 Mar 2010 17:43:44 +0100 |
parents | ee72d89c0d9f |
children | 71cf11f03b3d |
comparison
equal
deleted
inserted
replaced
10650:9ea7238ad935 | 10651:5f091fc1bab7 |
---|---|
8 | 8 |
9 from i18n import _ | 9 from i18n import _ |
10 from lock import release | 10 from lock import release |
11 import localrepo, bundlerepo, httprepo, sshrepo, statichttprepo | 11 import localrepo, bundlerepo, httprepo, sshrepo, statichttprepo |
12 import lock, util, extensions, error, encoding, node | 12 import lock, util, extensions, error, encoding, node |
13 import merge as _merge | 13 import merge as mergemod |
14 import verify as _verify | 14 import verify as verifymod |
15 import errno, os, shutil | 15 import errno, os, shutil |
16 | 16 |
17 def _local(path): | 17 def _local(path): |
18 return (os.path.isfile(util.drop_scheme('file', path)) and | 18 return (os.path.isfile(util.drop_scheme('file', path)) and |
19 bundlerepo or localrepo) | 19 bundlerepo or localrepo) |
356 repo.ui.status(_("%d files updated, %d files merged, " | 356 repo.ui.status(_("%d files updated, %d files merged, " |
357 "%d files removed, %d files unresolved\n") % stats) | 357 "%d files removed, %d files unresolved\n") % stats) |
358 | 358 |
359 def update(repo, node): | 359 def update(repo, node): |
360 """update the working directory to node, merging linear changes""" | 360 """update the working directory to node, merging linear changes""" |
361 stats = _merge.update(repo, node, False, False, None) | 361 stats = mergemod.update(repo, node, False, False, None) |
362 _showstats(repo, stats) | 362 _showstats(repo, stats) |
363 if stats[3]: | 363 if stats[3]: |
364 repo.ui.status(_("use 'hg resolve' to retry unresolved file merges\n")) | 364 repo.ui.status(_("use 'hg resolve' to retry unresolved file merges\n")) |
365 return stats[3] > 0 | 365 return stats[3] > 0 |
366 | 366 |
367 # naming conflict in clone() | 367 # naming conflict in clone() |
368 _update = update | 368 _update = update |
369 | 369 |
370 def clean(repo, node, show_stats=True): | 370 def clean(repo, node, show_stats=True): |
371 """forcibly switch the working directory to node, clobbering changes""" | 371 """forcibly switch the working directory to node, clobbering changes""" |
372 stats = _merge.update(repo, node, False, True, None) | 372 stats = mergemod.update(repo, node, False, True, None) |
373 if show_stats: | 373 if show_stats: |
374 _showstats(repo, stats) | 374 _showstats(repo, stats) |
375 return stats[3] > 0 | 375 return stats[3] > 0 |
376 | 376 |
377 def merge(repo, node, force=None, remind=True): | 377 def merge(repo, node, force=None, remind=True): |
378 """branch merge with node, resolving changes""" | 378 """branch merge with node, resolving changes""" |
379 stats = _merge.update(repo, node, True, force, False) | 379 stats = mergemod.update(repo, node, True, force, False) |
380 _showstats(repo, stats) | 380 _showstats(repo, stats) |
381 if stats[3]: | 381 if stats[3]: |
382 repo.ui.status(_("use 'hg resolve' to retry unresolved file merges " | 382 repo.ui.status(_("use 'hg resolve' to retry unresolved file merges " |
383 "or 'hg update -C' to abandon\n")) | 383 "or 'hg update -C' to abandon\n")) |
384 elif remind: | 384 elif remind: |
385 repo.ui.status(_("(branch merge, don't forget to commit)\n")) | 385 repo.ui.status(_("(branch merge, don't forget to commit)\n")) |
386 return stats[3] > 0 | 386 return stats[3] > 0 |
387 | 387 |
388 def revert(repo, node, choose): | 388 def revert(repo, node, choose): |
389 """revert changes to revision in node without updating dirstate""" | 389 """revert changes to revision in node without updating dirstate""" |
390 return _merge.update(repo, node, False, True, choose)[3] > 0 | 390 return mergemod.update(repo, node, False, True, choose)[3] > 0 |
391 | 391 |
392 def verify(repo): | 392 def verify(repo): |
393 """verify the consistency of a repository""" | 393 """verify the consistency of a repository""" |
394 return _verify.verify(repo) | 394 return verifymod.verify(repo) |