diff 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
line wrap: on
line diff
--- a/hgsubversion/wrappers.py
+++ b/hgsubversion/wrappers.py
@@ -27,6 +27,7 @@ except ImportError:
     logcmdutil = None
 from mercurial import scmutil
 
+import compathacks
 import replay
 import pushmod
 import stupid as stupidmod
@@ -502,7 +503,8 @@ def pull(repo, source, heads=[], force=F
                             w = hgutil.termwidth()
                         bits = (r.revnum, r.author, msg)
                         ui.status(('[r%d] %s: %s' % bits)[:w] + '\n')
-                        ui.progress('pull', r.revnum - start, total=total)
+                        compathacks.progress(ui, 'pull', r.revnum - start,
+                                             total=total)
 
                         meta.save_tbdelta(tbdelta)
                         close = pullfuns[have_replay](ui, meta, svn, r, tbdelta,
@@ -539,7 +541,7 @@ def pull(repo, source, heads=[], force=F
             lock.release()
     finally:
         if total is not None:
-            ui.progress('pull', None, total=total)
+            compathacks.progress(ui, 'pull', None, total=total)
         util.swap_out_encoding(old_encoding)
 
     if lastpulled is not None: