Patchwork buildrpm: do not break when hg log is an alias

login
register
mail settings
Submitter via Mercurial-devel
Date Aug. 3, 2017, 9:41 p.m.
Message ID <413a0de052390c2fa49c.1501796507@cuben>
Download mbox | patch
Permalink /patch/22662/
State Superseded
Headers show

Comments

via Mercurial-devel - Aug. 3, 2017, 9:41 p.m.
# HG changeset patch
# User muxator <a.mux@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.

Patch

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