2 # Parent 89661813f5014dfceaa7e5be8dd57cebdab6a9d0
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 89661813f501 ircd/version.c.SH
16 --- a/ircd/version.c.SH
17 +++ b/ircd/version.c.SH
19 echo " \"[" `./umkpasswd -5 $file` " ]\"," >> 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!