comparison hgext/gpg.py @ 3919:b12eae71382d

merge with crew-stable
author Thomas Arendsen Hein <thomas@intevation.de>
date Sat, 16 Dec 2006 23:36:06 +0100
parents 6b4127c7d52a b1806b211910
children eadfaa9ec487
comparison
equal deleted inserted replaced
3909:dd86f99e3c02 3919:b12eae71382d
192 return "%s (%s)" % (user, comment) 192 return "%s (%s)" % (user, comment)
193 else: 193 else:
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 tip or a given revision""" 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:
204 nodes = [repo.changelog.tip()] 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:
215 nodes = [repo.changelog.tip()]
205 216
206 for n in nodes: 217 for n in nodes:
207 hexnode = hgnode.hex(n) 218 hexnode = hgnode.hex(n)
208 ui.write("Signing %d:%s\n" % (repo.changelog.rev(n), 219 ui.write("Signing %d:%s\n" % (repo.changelog.rev(n),
209 hgnode.short(n))) 220 hgnode.short(n)))