[PATCH] buildrpm: do not break when hg log is an alias

a.mux at inwind.it a.mux at inwind.it
Thu Aug 3 21:41:47 UTC 2017


# HG changeset patch
# User muxator <a.mux at inwind.it>
# Date 1501762748 -7200
#      Thu Aug 03 14:19:08 2017 +0200
# Branch stable
# Node ID 413a0de052390c2fa49cf2b98b6a6c7a3fe74546
# Parent  524b13fc711f76343557f054d2a11678ef83f8c8
buildrpm: do not break when hg log is an alias

If "hg log" is defined as an alias, for example:

  # /etc/mercurial/hgrc
  [alias]
  log = log --graph

the rpm build script breaks while trying to parse log messages formatted
in unexpected ways.
This patch resets the log output to its default.

diff --git a/contrib/buildrpm b/contrib/buildrpm
--- a/contrib/buildrpm
+++ b/contrib/buildrpm
@@ -104,7 +104,7 @@
 
 if echo $version | grep '+' > /dev/null 2>&1; then
     latesttag="`echo $version | sed -e 's/+.*//'`"
-    $HG log -r .:"$latesttag" -fM \
+    $HG log --config alias.log=log -r .:"$latesttag" -fM \
         --template '{date|hgdate}\t{author}\t{desc|firstline}\n' | python -c '
 import sys, time
 
@@ -128,7 +128,7 @@
 
 else
 
-    $HG log \
+    $HG log --config alias.log=log \
          --template '{date|hgdate}\t{author}\t{desc|firstline}\n' \
          .hgtags | python -c '
 import sys, time


More information about the Mercurial-devel mailing list