Revert hgeditor change to manifest bits
authorMatt Mackall <mpm@selenic.com>
Mon, 11 Jul 2005 21:54:37 -0800
changeset 683 104d2aee3b442f2ee4b2e9d059bc1d8981526e81
parent 682 d6723636c1726e8b872a5dc8401944aab215e705
child 684 4ccf3de52989b14c3d84e1097f59e39a992e00bd
push id1
push usergszorc@mozilla.com
push dateWed, 18 Mar 2015 16:34:57 +0000
Revert hgeditor change to manifest bits -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Revert hgeditor change to manifest bits I'd rather have a blank line at the top. This code primarily exists to show possible methods of signing changesets so I'm not very concerned about conciseness or performance. I should probably have all the signing commented out or disabled by default. manifest hash: 764da8d65bdaf9b45c7e3efd6cd2b4ee70979417 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) iD8DBQFC01sdywK+sNU5EO8RAr2BAJ9Uq0XberFrYyehvmoKgE8p/j0XFQCdFPJr DPDMbKeBHwK/yMiileBFW8o= =DvnD -----END PGP SIGNATURE-----
hgeditor
--- a/hgeditor
+++ b/hgeditor
@@ -22,22 +22,20 @@ esac
 
 if grep -q "^HG: merge resolve" "$1" ; then
     # we don't sign merges
     exec $EDITOR "$1"
 else
     # Remove temporary files even if we get interrupted
     trap "cleanup_exit 255" TERM KILL INT QUIT ABRT
     T1=`mktemp`; T2=`mktemp`
+    MANIFEST=`grep '^HG: manifest hash' "$1" | cut -b 19-`
 
-    # Add manifest hash in order to sign whole repository state.
-    # Remove HG: prefix, as we want that to be stored.
-    grep '^HG: manifest hash' "$1" | cut -b 5- >> "$T1"
-    # Add all other state information
-    grep -v '^HG: manifest hash' "$1" >> "$T1"
+    echo -e "\n\nmanifest hash: $MANIFEST" >> "$T1"
+    grep -vE '^(HG: manifest hash .*)?$' "$1" >> "$T1"
     (
         cd "`hg root`"
         grep '^HG: changed' "$1" | cut -b 13- | while read changed; do
             hg diff "$changed" >> "$T2"
         done
     )
 
     CHECKSUM=`md5sum "$T1"`