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