Mercurial > hgsubversion
comparison hgsubversion/wrappers.py @ 1601:5d8603f080c5
compathacks: add compat code for ui.makeprogress() deprecation
ui.makeprogress() is deprecated and will be dropped in 5.1. This patch adds
compat code for that. The compat code is plain copy of compat code available in
evolve extension.
author | Pulkit Goyal <pulkit@yandex-team.ru> |
---|---|
date | Mon, 04 Feb 2019 20:56:39 +0300 |
parents | e15dc9e9cd56 |
children |
comparison
equal
deleted
inserted
replaced
1600:6f5b296c01dd | 1601:5d8603f080c5 |
---|---|
25 except ImportError: | 25 except ImportError: |
26 # hg 4.5 and earlier | 26 # hg 4.5 and earlier |
27 logcmdutil = None | 27 logcmdutil = None |
28 from mercurial import scmutil | 28 from mercurial import scmutil |
29 | 29 |
30 import compathacks | |
30 import replay | 31 import replay |
31 import pushmod | 32 import pushmod |
32 import stupid as stupidmod | 33 import stupid as stupidmod |
33 import svnwrap | 34 import svnwrap |
34 import util | 35 import util |
500 w = ui.termwidth() | 501 w = ui.termwidth() |
501 else: | 502 else: |
502 w = hgutil.termwidth() | 503 w = hgutil.termwidth() |
503 bits = (r.revnum, r.author, msg) | 504 bits = (r.revnum, r.author, msg) |
504 ui.status(('[r%d] %s: %s' % bits)[:w] + '\n') | 505 ui.status(('[r%d] %s: %s' % bits)[:w] + '\n') |
505 ui.progress('pull', r.revnum - start, total=total) | 506 compathacks.progress(ui, 'pull', r.revnum - start, |
507 total=total) | |
506 | 508 |
507 meta.save_tbdelta(tbdelta) | 509 meta.save_tbdelta(tbdelta) |
508 close = pullfuns[have_replay](ui, meta, svn, r, tbdelta, | 510 close = pullfuns[have_replay](ui, meta, svn, r, tbdelta, |
509 firstrun) | 511 firstrun) |
510 meta.committags(r, close) | 512 meta.committags(r, close) |
537 ui.traceback() | 539 ui.traceback() |
538 finally: | 540 finally: |
539 lock.release() | 541 lock.release() |
540 finally: | 542 finally: |
541 if total is not None: | 543 if total is not None: |
542 ui.progress('pull', None, total=total) | 544 compathacks.progress(ui, 'pull', None, total=total) |
543 util.swap_out_encoding(old_encoding) | 545 util.swap_out_encoding(old_encoding) |
544 | 546 |
545 if lastpulled is not None: | 547 if lastpulled is not None: |
546 meta.revmap.lastpulled = lastpulled | 548 meta.revmap.lastpulled = lastpulled |
547 revisions = len(meta.revmap) - oldrevisions | 549 revisions = len(meta.revmap) - oldrevisions |