Show More
@@ -194,13 +194,24 b' def keystr(ui, key):' | |||||
194 | return user |
|
194 | return user | |
195 |
|
195 | |||
196 | def sign(ui, repo, *revs, **opts): |
|
196 | def sign(ui, repo, *revs, **opts): | |
197 |
"""add a signature for the current |
|
197 | """add a signature for the current or given revision | |
|
198 | ||||
|
199 | If no revision is given, the parent of the working directory is used, | |||
|
200 | or tip if no revision is checked out. | |||
|
201 | """ | |||
|
202 | ||||
198 | mygpg = newgpg(ui, **opts) |
|
203 | mygpg = newgpg(ui, **opts) | |
199 | sigver = "0" |
|
204 | sigver = "0" | |
200 | sigmessage = "" |
|
205 | sigmessage = "" | |
201 | if revs: |
|
206 | if revs: | |
202 | nodes = [repo.lookup(n) for n in revs] |
|
207 | nodes = [repo.lookup(n) for n in revs] | |
203 | else: |
|
208 | else: | |
|
209 | nodes = [node for node in repo.dirstate.parents() | |||
|
210 | if node != hgnode.nullid] | |||
|
211 | if len(nodes) > 1: | |||
|
212 | raise util.Abort(_('uncommitted merge - please provide a ' | |||
|
213 | 'specific revision')) | |||
|
214 | if not nodes: | |||
204 | nodes = [repo.changelog.tip()] |
|
215 | nodes = [repo.changelog.tip()] | |
205 |
|
216 | |||
206 | for n in nodes: |
|
217 | for n in nodes: |
General Comments 0
You need to be logged in to leave comments.
Login now