comparison mercurial/hg.py @ 185:db3aa85b9379

Add manifest hash to commit messages for easy signing -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Here's an example: This is the current manifest hash: e06d11165178d03c296ea7e7854f91e612a8d6bf It was copied from the HG: comment lines that are added to the commit. Then I wrote this commit message, signed it, then closed the commit. The manifest hash is a hash of all the files in the project together with the hashes of manifest's parents. Thus, signing the manifest hash allows us to verify the entire state of project at the time of the commit. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) iD8DBQFCmMrcywK+sNU5EO8RAoKwAJ4gPz2dI1Xh44N3tra43clUGhLVggCbBxuu 8pBZt85SA9ty39+e2+hL9WI= =t/xS -----END PGP SIGNATURE-----
author mpm@selenic.com
date Sat, 28 May 2005 11:48:00 -0800
parents 089594a5bbde
children 9a2075c0b9b8
comparison
equal deleted inserted replaced
184:697f05bfe976 185:db3aa85b9379
355 355
356 # add changeset 356 # add changeset
357 new = new.keys() 357 new = new.keys()
358 new.sort() 358 new.sort()
359 359
360 edittext = text + "\n"+"".join(["HG: changed %s\n" % f for f in new]) 360 edittext = text + "\n" + "HG: manifest hash %s\n" % hex(mnode)
361 edittext += "".join(["HG: changed %s\n" % f for f in new])
361 edittext += "".join(["HG: removed %s\n" % f for f in remove]) 362 edittext += "".join(["HG: removed %s\n" % f for f in remove])
362 edittext = self.ui.edit(edittext) 363 edittext = self.ui.edit(edittext)
363 364
364 n = self.changelog.add(mnode, new, edittext, tr) 365 n = self.changelog.add(mnode, new, edittext, tr)
365 tr.close() 366 tr.close()
766 # and manifest id to the changelog 767 # and manifest id to the changelog
767 self.ui.status("committing merge changeset\n") 768 self.ui.status("committing merge changeset\n")
768 if co == cn: cn = -1 769 if co == cn: cn = -1
769 770
770 edittext = "\nHG: merge resolve\n" + \ 771 edittext = "\nHG: merge resolve\n" + \
772 "HG: manifest hash %s\n" % hex(mnode) + \
771 "".join(["HG: changed %s\n" % f for f in new]) 773 "".join(["HG: changed %s\n" % f for f in new])
772 edittext = self.ui.edit(edittext) 774 edittext = self.ui.edit(edittext)
773 n = self.changelog.add(node, new, edittext, tr, co, cn) 775 n = self.changelog.add(node, new, edittext, tr, co, cn)
774 776
775 tr.close() 777 tr.close()