Mercurial > public > mercurial-scm > hg
comparison mercurial/debugcommands.py @ 30946:7103122495e2
debugcommands: move 'debugpushkey' in the new module
author | Pierre-Yves David <pierre-yves.david@ens-lyon.org> |
---|---|
date | Wed, 01 Feb 2017 17:48:30 +0100 |
parents | c8081ea63591 |
children | 3c766ca89377 |
comparison
equal
deleted
inserted
replaced
30945:8b83b626fb1e | 30946:7103122495e2 |
---|---|
1412 dirs.update(d) | 1412 dirs.update(d) |
1413 files.update(dirs) | 1413 files.update(dirs) |
1414 ui.write('\n'.join(repo.pathto(p, cwd) for p in sorted(files))) | 1414 ui.write('\n'.join(repo.pathto(p, cwd) for p in sorted(files))) |
1415 ui.write('\n') | 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 @command('debugupgraderepo', [ | 1438 @command('debugupgraderepo', [ |
1418 ('o', 'optimize', [], _('extra optimization to perform'), _('NAME')), | 1439 ('o', 'optimize', [], _('extra optimization to perform'), _('NAME')), |
1419 ('', 'run', False, _('performs an upgrade')), | 1440 ('', 'run', False, _('performs an upgrade')), |
1420 ]) | 1441 ]) |
1421 def debugupgraderepo(ui, repo, run=False, optimize=None): | 1442 def debugupgraderepo(ui, repo, run=False, optimize=None): |