##// END OF EJS Templates
pushkey: add debugpushkey command for testing
Matt Mackall -
r11371:4c8842ee default
parent child Browse files
Show More
@@ -1082,6 +1082,26 b' def showconfig(ui, repo, *values, **opts'
1082 ui.configsource(section, name, untrusted))
1082 ui.configsource(section, name, untrusted))
1083 ui.write('%s=%s\n' % (sectname, value))
1083 ui.write('%s=%s\n' % (sectname, value))
1084
1084
1085 def debugpushkey(ui, repopath, namespace, *keyinfo):
1086 '''access the pushkey key/value protocol
1087
1088 With two args, list the keys in the given namespace.
1089
1090 With five args, set a key to new if it currently is set to old.
1091 Reports success or failure.
1092 '''
1093
1094 target = hg.repository(ui, repopath)
1095 if keyinfo:
1096 key, old, new = keyinfo
1097 r = target.pushkey(namespace, key, old, new)
1098 ui.status(str(r) + '\n')
1099 return not(r)
1100 else:
1101 for k, v in target.listkeys(namespace).iteritems():
1102 ui.write("%s\t%s\n" % (k.encode('string-escape'),
1103 v.encode('string-escape')))
1104
1085 def debugrevspec(ui, repo, expr):
1105 def debugrevspec(ui, repo, expr):
1086 '''parse and apply a revision specification'''
1106 '''parse and apply a revision specification'''
1087 if ui.verbose:
1107 if ui.verbose:
@@ -4072,6 +4092,7 b' table = {'
4072 "debugindex": (debugindex, [], _('FILE')),
4092 "debugindex": (debugindex, [], _('FILE')),
4073 "debugindexdot": (debugindexdot, [], _('FILE')),
4093 "debugindexdot": (debugindexdot, [], _('FILE')),
4074 "debuginstall": (debuginstall, [], ''),
4094 "debuginstall": (debuginstall, [], ''),
4095 "debugpushkey": (debugpushkey, [], _('REPO NAMESPACE [KEY OLD NEW]')),
4075 "debugrebuildstate":
4096 "debugrebuildstate":
4076 (debugrebuildstate,
4097 (debugrebuildstate,
4077 [('r', 'rev', '',
4098 [('r', 'rev', '',
@@ -4420,5 +4441,6 b' table = {'
4420 }
4441 }
4421
4442
4422 norepo = ("clone init version help debugcommands debugcomplete debugdata"
4443 norepo = ("clone init version help debugcommands debugcomplete debugdata"
4423 " debugindex debugindexdot debugdate debuginstall debugfsinfo")
4444 " debugindex debugindexdot debugdate debuginstall debugfsinfo"
4445 " debugpushkey")
4424 optionalrepo = ("identify paths serve showconfig debugancestor debugdag")
4446 optionalrepo = ("identify paths serve showconfig debugancestor debugdag")
@@ -73,6 +73,7 b' debugfsinfo'
73 debugindex
73 debugindex
74 debugindexdot
74 debugindexdot
75 debuginstall
75 debuginstall
76 debugpushkey
76 debugrebuildstate
77 debugrebuildstate
77 debugrename
78 debugrename
78 debugrevspec
79 debugrevspec
@@ -204,6 +205,7 b' debugfsinfo:'
204 debugindex:
205 debugindex:
205 debugindexdot:
206 debugindexdot:
206 debuginstall:
207 debuginstall:
208 debugpushkey:
207 debugrebuildstate: rev
209 debugrebuildstate: rev
208 debugrename: rev
210 debugrename: rev
209 debugrevspec:
211 debugrevspec:
General Comments 0
You need to be logged in to leave comments. Login now