# HG changeset patch # User Matt Mackall # Date 1264741990 21600 # Node ID cade47dcac2de86bf3aae345dd6547c1715075c1 # Parent ea7a14ca118a49bcfa52afaad4c49154a0cefa3b# Parent 44c923eeb81d64d7a00d6d2271c86821e70c95f0 Merge with stable diff -r ea7a14ca118a -r cade47dcac2d mercurial/config.py --- a/mercurial/config.py Thu Jan 28 22:45:04 2010 -0600 +++ b/mercurial/config.py Thu Jan 28 23:13:10 2010 -0600 @@ -73,10 +73,10 @@ def parse(self, src, data, sections=None, remap=None, include=None): sectionre = re.compile(r'\[([^\[]+)\]') itemre = re.compile(r'([^=\s][^=]*?)\s*=\s*(.*\S|)') - contre = re.compile(r'\s+(\S.*\S)') + contre = re.compile(r'\s+(\S|\S.*\S)\s*$') emptyre = re.compile(r'(;|#|\s*$)') unsetre = re.compile(r'%unset\s+(\S+)') - includere = re.compile(r'%include\s+(\S.*\S)') + includere = re.compile(r'%include\s+(\S|\S.*\S)\s*$') section = "" item = None line = 0 diff -r ea7a14ca118a -r cade47dcac2d mercurial/copies.py --- a/mercurial/copies.py Thu Jan 28 22:45:04 2010 -0600 +++ b/mercurial/copies.py Thu Jan 28 23:13:10 2010 -0600 @@ -154,7 +154,7 @@ break # no merge needed, quit early c2 = ctx(of, m2[of]) cr = related(oc, c2, ca.rev()) - if of == f or of == c2.path(): # non-divergent + if cr and (cr.path() == f or cr.path == c2.path()): # non-divergent copy[f] = of of = None break diff -r ea7a14ca118a -r cade47dcac2d tests/test-hgrc --- a/tests/test-hgrc Thu Jan 28 22:45:04 2010 -0600 +++ b/tests/test-hgrc Thu Jan 28 23:13:10 2010 -0600 @@ -19,5 +19,9 @@ echo ' x = y' >> $HGRCPATH hg version 2>&1 | sed -e "s|$HGRCPATH|\$HGRCPATH|" +python -c "print '[foo]\nbar = a\n b\n c \n de\n fg \nbaz = bif cb \n'" \ + > $HGRCPATH +hg showconfig foo + echo '%include /no-such-file' > $HGRCPATH hg version 2>&1 | sed -e "s|$HGRCPATH|\$HGRCPATH|" diff -r ea7a14ca118a -r cade47dcac2d tests/test-hgrc.out --- a/tests/test-hgrc.out Thu Jan 28 22:45:04 2010 -0600 +++ b/tests/test-hgrc.out Thu Jan 28 23:13:10 2010 -0600 @@ -7,4 +7,6 @@ bundle.mainreporoot=.../foobar paths.default=.../foo%bar hg: config error at $HGRCPATH:2: ' x = y' +foo.bar=a\nb\nc\nde\nfg +foo.baz=bif cb hg: config error at $HGRCPATH:1: cannot include /no-such-file (No such file or directory)