diff --git a/mercurial/posix.py b/mercurial/posix.py --- a/mercurial/posix.py +++ b/mercurial/posix.py @@ -322,7 +322,7 @@ def shellquote(s): global _needsshellquote if _needsshellquote is None: _needsshellquote = re.compile(r'[^a-zA-Z0-9._/-]').search - if not _needsshellquote(s): + if s and not _needsshellquote(s): # "s" shouldn't have to be quoted return s else: diff --git a/mercurial/subrepo.py b/mercurial/subrepo.py --- a/mercurial/subrepo.py +++ b/mercurial/subrepo.py @@ -245,7 +245,7 @@ def submerge(repo, wctx, mctx, actx, ove 'use (c)hanged version or (d)elete?' '$$ &Changed $$ &Delete') % s, 0) == 0: debug(s, "prompt recreate", r) - wctx.sub(s).get(r) + mctx.sub(s).get(r) sm[s] = r # record merged .hgsubstate diff --git a/mercurial/templates/monoblue/changeset.tmpl b/mercurial/templates/monoblue/changeset.tmpl --- a/mercurial/templates/monoblue/changeset.tmpl +++ b/mercurial/templates/monoblue/changeset.tmpl @@ -39,7 +39,7 @@

{desc|strip|escape|firstline|nonempty} {inbranch%inbranchtag}{branches%branchtag}{tags%tagtag}{bookmarks%bookmarktag}

-

{date|rfc822date}

+

{date|rfc822date}

author
diff --git a/mercurial/templates/monoblue/fileannotate.tmpl b/mercurial/templates/monoblue/fileannotate.tmpl --- a/mercurial/templates/monoblue/fileannotate.tmpl +++ b/mercurial/templates/monoblue/fileannotate.tmpl @@ -41,7 +41,7 @@

{file|escape}

-

{date|rfc822date}

+

{date|rfc822date}

author
diff --git a/mercurial/templates/monoblue/filerevision.tmpl b/mercurial/templates/monoblue/filerevision.tmpl --- a/mercurial/templates/monoblue/filerevision.tmpl +++ b/mercurial/templates/monoblue/filerevision.tmpl @@ -41,7 +41,7 @@

{file|escape}

-

{date|rfc822date}

+

{date|rfc822date}

author
diff --git a/mercurial/windows.py b/mercurial/windows.py --- a/mercurial/windows.py +++ b/mercurial/windows.py @@ -167,7 +167,7 @@ def shellquote(s): # they are used as a part of path name (and the latter doesn't # work as "escape character", like one on posix) on Windows _needsshellquote = re.compile(r'[^a-zA-Z0-9._:/\\-]').search - if not _needsshellquote(s) and not _quotere.search(s): + if s and not _needsshellquote(s) and not _quotere.search(s): # "s" shouldn't have to be quoted return s return '"%s"' % _quotere.sub(r'\1\1\\\2', s) diff --git a/tests/test-extdiff.t b/tests/test-extdiff.t --- a/tests/test-extdiff.t +++ b/tests/test-extdiff.t @@ -182,6 +182,22 @@ TODO running "*/bin/echo --foo='sp ace' 'sp ace' --bar='sp ace' 'sp ace'" in * (glob) #endif +Empty argument must be quoted + + $ cat <> $HGRCPATH + > [extdiff] + > kdiff3 = echo + > [merge-tools] + > kdiff3.diffargs=--L1 \$plabel1 --L2 \$clabel \$parent \$child + > EOF +#if windows + $ hg --debug kdiff3 -r0 | grep '^running' + running 'echo --L1 "@0" --L2 "" a.8a5febb7f867 a' in * (glob) +#else + $ hg --debug kdiff3 -r0 | grep '^running' + running "echo --L1 '@0' --L2 '' a.8a5febb7f867 a" in * (glob) +#endif + #if execbit Test extdiff of multiple files in tmp dir: diff --git a/tests/test-subrepo.t b/tests/test-subrepo.t --- a/tests/test-subrepo.t +++ b/tests/test-subrepo.t @@ -311,6 +311,138 @@ should conflict t3 >>>>>>> other: 7af322bc1198 - test: 7 +11: remove subrepo t + + $ hg co -C 5 + 1 files updated, 0 files merged, 0 files removed, 0 files unresolved + $ hg revert -r 4 .hgsub # remove t + $ hg ci -m11 + created new head + $ hg debugsub + path s + source s + revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 + +local removed, remote changed, keep changed + + $ hg merge 6 + remote changed subrepository t which local removed + use (c)hanged version or (d)elete? c + 0 files updated, 0 files merged, 0 files removed, 0 files unresolved + (branch merge, don't forget to commit) +BROKEN: should include subrepo t + $ hg debugsub + path s + source s + revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 + $ cat .hgsubstate + e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s + 6747d179aa9a688023c4b0cad32e4c92bb7f34ad t + $ hg ci -m 'local removed, remote changed, keep changed' +BROKEN: should include subrepo t + $ hg debugsub + path s + source s + revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 +BROKEN: should include subrepo t + $ cat .hgsubstate + e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s + $ cat t/t + t2 + +local removed, remote changed, keep removed + + $ hg co -C 11 + 1 files updated, 0 files merged, 0 files removed, 0 files unresolved + $ hg merge --config ui.interactive=true 6 < d + > EOF + remote changed subrepository t which local removed + use (c)hanged version or (d)elete? d + 0 files updated, 0 files merged, 0 files removed, 0 files unresolved + (branch merge, don't forget to commit) + $ hg debugsub + path s + source s + revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 + $ cat .hgsubstate + e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s + $ hg ci -m 'local removed, remote changed, keep removed' + created new head + $ hg debugsub + path s + source s + revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 + $ cat .hgsubstate + e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s + +local changed, remote removed, keep changed + + $ hg co -C 6 + 2 files updated, 0 files merged, 0 files removed, 0 files unresolved + $ hg merge 11 + local changed subrepository t which remote removed + use (c)hanged version or (d)elete? c + 1 files updated, 0 files merged, 0 files removed, 0 files unresolved + (branch merge, don't forget to commit) +BROKEN: should include subrepo t + $ hg debugsub + path s + source s + revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 +BROKEN: should include subrepo t + $ cat .hgsubstate + e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s + $ hg ci -m 'local changed, remote removed, keep changed' + created new head +BROKEN: should include subrepo t + $ hg debugsub + path s + source s + revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 +BROKEN: should include subrepo t + $ cat .hgsubstate + e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s + $ cat t/t + t2 + +local changed, remote removed, keep removed + + $ hg co -C 6 + 2 files updated, 0 files merged, 0 files removed, 0 files unresolved + $ hg merge --config ui.interactive=true 11 < d + > EOF + local changed subrepository t which remote removed + use (c)hanged version or (d)elete? d + 1 files updated, 0 files merged, 0 files removed, 0 files unresolved + (branch merge, don't forget to commit) + $ hg debugsub + path s + source s + revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 + $ cat .hgsubstate + e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s + $ hg ci -m 'local changed, remote removed, keep removed' + created new head + $ hg debugsub + path s + source s + revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 + $ cat .hgsubstate + e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s + +clean up to avoid having to fix up the tests below + + $ hg co -C 10 + 2 files updated, 0 files merged, 0 files removed, 0 files unresolved + $ cat >> $HGRCPATH < [extensions] + > strip= + > EOF + $ hg strip -r 11:15 + saved backup bundle to $TESTTMP/t/.hg/strip-backup/*-backup.hg (glob) + clone $ cd ..