This revision was automatically updated to reflect the committed changes.
Closed by commit rHG516b5a5edae3: exchange: use command executor for pushkey 
(authored by indygreg, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3315?vs=8135&id=8183

REVISION DETAIL
  https://phab.mercurial-scm.org/D3315

AFFECTED FILES
  mercurial/debugcommands.py
  mercurial/exchange.py

CHANGE DETAILS

diff --git a/mercurial/exchange.py b/mercurial/exchange.py
--- a/mercurial/exchange.py
+++ b/mercurial/exchange.py
@@ -1212,10 +1212,14 @@
         outdated = [c for c in outdated if c.node() not in pheads]
         # fallback to independent pushkey command
         for newremotehead in outdated:
-            r = pushop.remote.pushkey('phases',
-                                      newremotehead.hex(),
-                                      ('%d' % phases.draft),
-                                      ('%d' % phases.public))
+            with pushop.remote.commandexecutor() as e:
+                r = e.callcommand('pushkey', {
+                    'namespace': 'phases',
+                    'key': newremotehead.hex(),
+                    'old': '%d' % phases.draft,
+                    'new': '%d' % phases.public
+                }).result()
+
             if not r:
                 pushop.ui.warn(_('updating %s to public failed!\n')
                                % newremotehead)
@@ -1270,7 +1274,16 @@
             action = 'export'
         elif not new:
             action = 'delete'
-        if remote.pushkey('bookmarks', b, old, new):
+
+        with remote.commandexecutor() as e:
+            r = e.callcommand('pushkey', {
+                'namespace': 'bookmarks',
+                'key': b,
+                'old': old,
+                'new': new,
+            }).result()
+
+        if r:
             ui.status(bookmsgmap[action][0] % b)
         else:
             ui.warn(bookmsgmap[action][1] % b)
diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py
--- a/mercurial/debugcommands.py
+++ b/mercurial/debugcommands.py
@@ -1832,7 +1832,14 @@
     target = hg.peer(ui, {}, repopath)
     if keyinfo:
         key, old, new = keyinfo
-        r = target.pushkey(namespace, key, old, new)
+        with target.commandexecutor() as e:
+            r = e.callcommand('pushkey', {
+                'namespace': namespace,
+                'key': key,
+                'old': old,
+                'new': new,
+            }).result()
+
         ui.status(pycompat.bytestr(r) + '\n')
         return not r
     else:



To: indygreg, #hg-reviewers, durin42
Cc: mercurial-devel
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to