2 # Parent cf10176805a0799e83451e1267a79eb055225adf
4 Add information from hg to INFO command.
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
11 This patch is to remain in the patch queue, at the top, for development purposes only.
13 Currently this patch sits in position 2 behind the patch for several fixes for m_info.c and version.c.SH.
15 diff -r cf10176805a0 ircd/version.c.SH
16 --- a/ircd/version.c.SH Sat Jul 20 15:04:47 2013 +0100
17 +++ b/ircd/version.c.SH Sat Jul 20 15:04:51 2013 +0100
20 ( for file in ${srcdir}/include/*.h ; do echo $file ; done ) | ./umkpasswd -5 >> version.c
23 +# gather info from HG
24 +if hg --help 2>&1 >/dev/null; then
26 + # gather info from the HG patch queue
27 + if [ -d ${srcdir}/.hg/patches ]; then
29 + echo "Extracting information from HG patch queue ..."
31 + # revision for applied patches
32 + echo " \"\"," >> version.c
33 + echo " \"PatchApplied:\"," >> version.c
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
40 + echo " \"[" $file: $revision " ]\"," >> version.c
43 + # checksums for all patch files
44 + echo " \"\"," >> version.c
45 + echo " \"PatchQueue:\"," >> version.c
47 + for file in $(cd ${srcdir} && hg qseries) ; do
48 + echo " \"[" `./umkpasswd -5 ${srcdir}/.hg/patches/$file` " ]\"," >> version.c
53 + echo "Extracting information from HG ..."
55 + # hg identify information
56 + echo "\"Mercurial information: hg identify "`cd ${srcdir} && hg identify`"\"," >> version.c
62 /bin/cat >>version.c <<!SUB!THIS!