-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhginfo.patch
64 lines (57 loc) · 1.8 KB
/
hginfo.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# HG changeset patch
# Parent cf10176805a0799e83451e1267a79eb055225adf
Add information from hg to INFO command.
Information added:
The output from 'hg identify'
The list of applied patches from the patch queue and their revisions
The list of patches from 'hg qseries' and their checksums
This patch is to remain in the patch queue, at the top, for development purposes only.
Currently this patch sits in position 2 behind the patch for several fixes for m_info.c and version.c.SH.
diff -r cf10176805a0 ircd/version.c.SH
--- a/ircd/version.c.SH Sat Jul 20 15:04:47 2013 +0100
+++ b/ircd/version.c.SH Sat Jul 20 15:04:51 2013 +0100
@@ -99,6 +99,46 @@
( for file in ${srcdir}/include/*.h ; do echo $file ; done ) | ./umkpasswd -5 >> version.c
+
+# gather info from HG
+if hg --help 2>&1 >/dev/null; then
+
+ # gather info from the HG patch queue
+ if [ -d ${srcdir}/.hg/patches ]; then
+
+ echo "Extracting information from HG patch queue ..."
+
+ # revision for applied patches
+ echo " \"\"," >> version.c
+ echo " \"PatchApplied:\"," >> version.c
+
+ for file in $(cd ${srcdir} && hg qapplied); do
+ revision=$(cd ${srcdir}/.hg/patches && hg log $file | grep ^changeset | head -n 1 | awk '{print $2}')
+ if [ -z "$revision" ]; then
+ revision="none"
+ fi
+ echo " \"[" $file: $revision " ]\"," >> version.c
+ done
+
+ # checksums for all patch files
+ echo " \"\"," >> version.c
+ echo " \"PatchQueue:\"," >> version.c
+
+ for file in $(cd ${srcdir} && hg qseries) ; do
+ echo " \"[" `./umkpasswd -5 ${srcdir}/.hg/patches/$file` " ]\"," >> version.c
+ done
+
+ fi
+
+ echo "Extracting information from HG ..."
+
+ # hg identify information
+ echo "\"Mercurial information: hg identify "`cd ${srcdir} && hg identify`"\"," >> version.c
+
+fi
+
+
+
/bin/cat >>version.c <<!SUB!THIS!
0,
};