##// END OF EJS Templates
debugcommands: move 'debugpushkey' in the new module
Pierre-Yves David -
r30946:71031224 default
parent child Browse files
Show More
@@ -1860,27 +1860,6 b' def copy(ui, repo, *pats, **opts):'
1860 1860 with repo.wlock(False):
1861 1861 return cmdutil.copy(ui, repo, pats, opts)
1862 1862
1863 @command('debugpushkey', [], _('REPO NAMESPACE [KEY OLD NEW]'), norepo=True)
1864 def debugpushkey(ui, repopath, namespace, *keyinfo, **opts):
1865 '''access the pushkey key/value protocol
1866
1867 With two args, list the keys in the given namespace.
1868
1869 With five args, set a key to new if it currently is set to old.
1870 Reports success or failure.
1871 '''
1872
1873 target = hg.peer(ui, {}, repopath)
1874 if keyinfo:
1875 key, old, new = keyinfo
1876 r = target.pushkey(namespace, key, old, new)
1877 ui.status(str(r) + '\n')
1878 return not r
1879 else:
1880 for k, v in sorted(target.listkeys(namespace).iteritems()):
1881 ui.write("%s\t%s\n" % (k.encode('string-escape'),
1882 v.encode('string-escape')))
1883
1884 1863 @command('debugpvec', [], _('A B'))
1885 1864 def debugpvec(ui, repo, a, b=None):
1886 1865 ca = scmutil.revsingle(repo, a)
@@ -1414,6 +1414,27 b' def debugpathcomplete(ui, repo, *specs, '
1414 1414 ui.write('\n'.join(repo.pathto(p, cwd) for p in sorted(files)))
1415 1415 ui.write('\n')
1416 1416
1417 @command('debugpushkey', [], _('REPO NAMESPACE [KEY OLD NEW]'), norepo=True)
1418 def debugpushkey(ui, repopath, namespace, *keyinfo, **opts):
1419 '''access the pushkey key/value protocol
1420
1421 With two args, list the keys in the given namespace.
1422
1423 With five args, set a key to new if it currently is set to old.
1424 Reports success or failure.
1425 '''
1426
1427 target = hg.peer(ui, {}, repopath)
1428 if keyinfo:
1429 key, old, new = keyinfo
1430 r = target.pushkey(namespace, key, old, new)
1431 ui.status(str(r) + '\n')
1432 return not r
1433 else:
1434 for k, v in sorted(target.listkeys(namespace).iteritems()):
1435 ui.write("%s\t%s\n" % (k.encode('string-escape'),
1436 v.encode('string-escape')))
1437
1417 1438 @command('debugupgraderepo', [
1418 1439 ('o', 'optimize', [], _('extra optimization to perform'), _('NAME')),
1419 1440 ('', 'run', False, _('performs an upgrade')),
General Comments 0
You need to be logged in to leave comments. Login now