Mercurial > hgsubversion
comparison hgsubversion/wrappers.py @ 1280:c791efb7082a
Merge with stable.
author | Augie Fackler <raf@durin42.com> |
---|---|
date | Wed, 10 Dec 2014 22:47:18 -0500 |
parents | 4744b7bfa476 b5520673f6f2 |
children | 8cec74df235a |
comparison
equal
deleted
inserted
replaced
1278:2ae577a4cd56 | 1280:c791efb7082a |
---|---|
519 ui.status("pulled %d revisions\n" % revisions) | 519 ui.status("pulled %d revisions\n" % revisions) |
520 | 520 |
521 def exchangepull(orig, repo, remote, heads=None, force=False, bookmarks=()): | 521 def exchangepull(orig, repo, remote, heads=None, force=False, bookmarks=()): |
522 capable = getattr(remote, 'capable', lambda x: False) | 522 capable = getattr(remote, 'capable', lambda x: False) |
523 if capable('subversion'): | 523 if capable('subversion'): |
524 # transaction manager is present in Mercurial >= 3.3 | |
525 try: | |
526 trmanager = getattr(exchange, 'transactionmanager') | |
527 except AttributeError: | |
528 trmanager = None | |
524 pullop = exchange.pulloperation(repo, remote, heads, force, | 529 pullop = exchange.pulloperation(repo, remote, heads, force, |
525 bookmarks=bookmarks) | 530 bookmarks=bookmarks) |
531 if trmanager: | |
532 pullop.trmanager = trmanager(repo, 'pull', remote.url()) | |
526 try: | 533 try: |
527 pullop.cgresult = pull(repo, remote, heads, force) | 534 pullop.cgresult = pull(repo, remote, heads, force) |
528 return pullop | 535 return pullop |
529 finally: | 536 finally: |
530 pullop.releasetransaction() | 537 if trmanager: |
538 pullop.trmanager.release() | |
539 else: | |
540 pullop.releasetransaction() | |
531 else: | 541 else: |
532 return orig(repo, remote, heads, force, bookmarks=bookmarks) | 542 return orig(repo, remote, heads, force, bookmarks=bookmarks) |
533 | 543 |
534 def rebase(orig, ui, repo, **opts): | 544 def rebase(orig, ui, repo, **opts): |
535 """rebase current unpushed revisions onto the Subversion head | 545 """rebase current unpushed revisions onto the Subversion head |