Mercurial > hg
comparison mercurial/debugcommands.py @ 37647:516b5a5edae3
exchange: use command executor for pushkey
Differential Revision: https://phab.mercurial-scm.org/D3315
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Fri, 13 Apr 2018 11:45:38 -0700 |
parents | 72b0982cd509 |
children | fe8c6f9f2914 |
comparison
equal
deleted
inserted
replaced
37646:72e26319f3b8 | 37647:516b5a5edae3 |
---|---|
1830 ''' | 1830 ''' |
1831 | 1831 |
1832 target = hg.peer(ui, {}, repopath) | 1832 target = hg.peer(ui, {}, repopath) |
1833 if keyinfo: | 1833 if keyinfo: |
1834 key, old, new = keyinfo | 1834 key, old, new = keyinfo |
1835 r = target.pushkey(namespace, key, old, new) | 1835 with target.commandexecutor() as e: |
1836 r = e.callcommand('pushkey', { | |
1837 'namespace': namespace, | |
1838 'key': key, | |
1839 'old': old, | |
1840 'new': new, | |
1841 }).result() | |
1842 | |
1836 ui.status(pycompat.bytestr(r) + '\n') | 1843 ui.status(pycompat.bytestr(r) + '\n') |
1837 return not r | 1844 return not r |
1838 else: | 1845 else: |
1839 for k, v in sorted(target.listkeys(namespace).iteritems()): | 1846 for k, v in sorted(target.listkeys(namespace).iteritems()): |
1840 ui.write("%s\t%s\n" % (stringutil.escapestr(k), | 1847 ui.write("%s\t%s\n" % (stringutil.escapestr(k), |