Show More
@@ -6,10 +6,13 b'' | |||
|
6 | 6 | '''commands to sign and verify changesets''' |
|
7 | 7 | |
|
8 | 8 | import os, tempfile, binascii |
|
9 | from mercurial import util, commands, match | |
|
9 | from mercurial import util, commands, match, cmdutil | |
|
10 | 10 | from mercurial import node as hgnode |
|
11 | 11 | from mercurial.i18n import _ |
|
12 | 12 | |
|
13 | cmdtable = {} | |
|
14 | command = cmdutil.command(cmdtable) | |
|
15 | ||
|
13 | 16 | class gpg(object): |
|
14 | 17 | def __init__(self, path, key=None): |
|
15 | 18 | self.path = path |
@@ -135,6 +138,7 b' def getkeys(ui, repo, mygpg, sigdata, co' | |||
|
135 | 138 | validkeys.append((key[1], key[2], key[3])) |
|
136 | 139 | return validkeys |
|
137 | 140 | |
|
141 | @command("sigs", [], _('hg sigs')) | |
|
138 | 142 | def sigs(ui, repo): |
|
139 | 143 | """list signed changesets""" |
|
140 | 144 | mygpg = newgpg(ui) |
@@ -159,6 +163,7 b' def sigs(ui, repo):' | |||
|
159 | 163 | r = "%5d:%s" % (rev, hgnode.hex(repo.changelog.node(rev))) |
|
160 | 164 | ui.write("%-30s %s\n" % (keystr(ui, k), r)) |
|
161 | 165 | |
|
166 | @command("sigcheck", [], _('hg sigcheck REVISION')) | |
|
162 | 167 | def check(ui, repo, rev): |
|
163 | 168 | """verify all the signatures there may be for a particular revision""" |
|
164 | 169 | mygpg = newgpg(ui) |
@@ -191,6 +196,16 b' def keystr(ui, key):' | |||
|
191 | 196 | else: |
|
192 | 197 | return user |
|
193 | 198 | |
|
199 | @command("sign", | |
|
200 | [('l', 'local', None, _('make the signature local')), | |
|
201 | ('f', 'force', None, _('sign even if the sigfile is modified')), | |
|
202 | ('', 'no-commit', None, _('do not commit the sigfile after signing')), | |
|
203 | ('k', 'key', '', | |
|
204 | _('the key id to sign with'), _('ID')), | |
|
205 | ('m', 'message', '', | |
|
206 | _('commit message'), _('TEXT')), | |
|
207 | ] + commands.commitopts2, | |
|
208 | _('hg sign [OPTION]... [REVISION]...')) | |
|
194 | 209 | def sign(ui, repo, *revs, **opts): |
|
195 | 210 | """add a signature for the current or given revision |
|
196 | 211 | |
@@ -272,19 +287,3 b' def node2txt(repo, node, ver):' | |||
|
272 | 287 | else: |
|
273 | 288 | raise util.Abort(_("unknown signature version")) |
|
274 | 289 | |
|
275 | cmdtable = { | |
|
276 | "sign": | |
|
277 | (sign, | |
|
278 | [('l', 'local', None, _('make the signature local')), | |
|
279 | ('f', 'force', None, _('sign even if the sigfile is modified')), | |
|
280 | ('', 'no-commit', None, _('do not commit the sigfile after signing')), | |
|
281 | ('k', 'key', '', | |
|
282 | _('the key id to sign with'), _('ID')), | |
|
283 | ('m', 'message', '', | |
|
284 | _('commit message'), _('TEXT')), | |
|
285 | ] + commands.commitopts2, | |
|
286 | _('hg sign [OPTION]... [REVISION]...')), | |
|
287 | "sigcheck": (check, [], _('hg sigcheck REVISION')), | |
|
288 | "sigs": (sigs, [], _('hg sigs')), | |
|
289 | } | |
|
290 |
General Comments 0
You need to be logged in to leave comments.
Login now