cmdutil: expand style paths (issue1948) stable
authorPatrick Mezard <pmezard@gmail.com>
Fri, 15 Jan 2010 09:50:52 +0100
branchstable
changeset 10249 8ebb34b0f6f7
parent 10243 cd3e5c47d663
child 10250 af24805aa37c
child 10251 a19d2993385d
cmdutil: expand style paths (issue1948) Fix suggested by Andrea Riciputi <andrea.riciputi@gmail.com>
mercurial/cmdutil.py
tests/test-command-template
tests/test-command-template.out
--- a/mercurial/cmdutil.py	Wed Jan 13 11:53:55 2010 +0100
+++ b/mercurial/cmdutil.py	Fri Jan 15 09:50:52 2010 +0100
@@ -1005,7 +1005,7 @@
         if tmpl:
             tmpl = templater.parsestring(tmpl)
         else:
-            style = ui.config('ui', 'style')
+            style = util.expandpath(ui.config('ui', 'style', ''))
 
     if not (tmpl or style):
         return changeset_printer(ui, repo, patch, opts, buffered)
--- a/tests/test-command-template	Wed Jan 13 11:53:55 2010 +0100
+++ b/tests/test-command-template	Fri Jan 15 09:50:52 2010 +0100
@@ -171,5 +171,18 @@
 hg tag -r 5 -m t5 -d '9 0' t5
 hg tag -r 3 -m at3 -d '10 0' at3
 hg log --template '{rev}: {latesttag}+{latesttagdistance}\n'
+cd ..
+
+echo '# style path expansion (issue1948)'
+mkdir -p home/styles
+cat > home/styles/teststyle <<EOF
+changeset = 'test {rev}:{node|short}\n'
+EOF
+HOME=`pwd`/home; export HOME
+cat > latesttag/.hg/hgrc <<EOF
+[ui]
+style = ~/styles/teststyle
+EOF
+hg -R latesttag tip
 
 echo '# done'
--- a/tests/test-command-template.out	Wed Jan 13 11:53:55 2010 +0100
+++ b/tests/test-command-template.out	Fri Jan 15 09:50:52 2010 +0100
@@ -723,4 +723,6 @@
 2: t2+0
 1: t1+0
 0: null+1
+# style path expansion (issue1948)
+test 10:dee8f28249af
 # done