subrepo: make sure that the source path is stripped stable
authorDavid Soria Parra <dsp@php.net>
Tue, 09 Feb 2010 18:32:57 +0100
branchstable
changeset 10457 4f38d03d4975
parent 10456 64a6a896e5fb
child 10458 7fbba0c04f92
child 10461 0add1e265ac2
subrepo: make sure that the source path is stripped Test by Patrick Mézard <pmezard@gmail.com>
mercurial/subrepo.py
tests/test-subrepo-svn
tests/test-subrepo-svn.out
--- a/mercurial/subrepo.py	Sat Feb 13 23:50:38 2010 -0600
+++ b/mercurial/subrepo.py	Tue Feb 09 18:32:57 2010 +0100
@@ -41,7 +41,7 @@
                 raise util.Abort(_('missing ] in subrepo source'))
             kind, src = src.split(']', 1)
             kind = kind[1:]
-        state[path] = (src, rev.get(path, ''), kind)
+        state[path] = (src.strip(), rev.get(path, ''), kind)
 
     return state
 
--- a/tests/test-subrepo-svn	Sat Feb 13 23:50:38 2010 -0600
+++ b/tests/test-subrepo-svn	Tue Feb 09 18:32:57 2010 +0100
@@ -49,8 +49,8 @@
 echo a > a
 hg ci -Am0
 
-echo % add first svn sub
-echo "s = [svn]$SVNREPO/src" >> .hgsub
+echo % add first svn sub with leading whitespaces
+echo "s = [svn]       $SVNREPO/src" >> .hgsub
 svn co --quiet $SVNREPO/src s
 hg add .hgsub
 hg ci -m1
--- a/tests/test-subrepo-svn.out	Sat Feb 13 23:50:38 2010 -0600
+++ b/tests/test-subrepo-svn.out	Tue Feb 09 18:32:57 2010 +0100
@@ -18,7 +18,7 @@
 % create hg repo
 % first revision, no sub
 adding a
-% add first svn sub
+% add first svn sub with leading whitespaces
 committing subrepository s
 % debugsub
 path s