changeset 24148:7a2194473155

merge with stable
author Matt Mackall <mpm@selenic.com>
date Fri, 27 Feb 2015 17:46:03 -0600
parents ba4fcd80079d (current diff) 756c5c8331b0 (diff)
children 758dd85b6ad6
files mercurial/subrepo.py mercurial/windows.py tests/test-subrepo.t
diffstat 8 files changed, 154 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/posix.py	Tue Feb 24 09:08:54 2015 -0800
+++ b/mercurial/posix.py	Fri Feb 27 17:46:03 2015 -0600
@@ -322,7 +322,7 @@
     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:
--- a/mercurial/subrepo.py	Tue Feb 24 09:08:54 2015 -0800
+++ b/mercurial/subrepo.py	Fri Feb 27 17:46:03 2015 -0600
@@ -245,7 +245,7 @@
                   '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
--- a/mercurial/templates/monoblue/changeset.tmpl	Tue Feb 24 09:08:54 2015 -0800
+++ b/mercurial/templates/monoblue/changeset.tmpl	Fri Feb 27 17:46:03 2015 -0600
@@ -39,7 +39,7 @@
     <h2 class="no-link no-border">changeset</h2>
 
     <h3 class="changeset"><a href="{url|urlescape}raw-rev/{node|short}">{desc|strip|escape|firstline|nonempty} <span class="logtags">{inbranch%inbranchtag}{branches%branchtag}{tags%tagtag}{bookmarks%bookmarktag}</span></a></h3>
-    <p class="changeset-age age">{date|rfc822date}</p>
+    <p class="changeset-age"><span class="age">{date|rfc822date}</span></p>
 
     <dl class="overview">
         <dt>author</dt>
--- a/mercurial/templates/monoblue/fileannotate.tmpl	Tue Feb 24 09:08:54 2015 -0800
+++ b/mercurial/templates/monoblue/fileannotate.tmpl	Fri Feb 27 17:46:03 2015 -0600
@@ -41,7 +41,7 @@
 
     <h2 class="no-link no-border">{file|escape}@{node|short} (annotated)</h2>
     <h3 class="changeset">{file|escape}</h3>
-    <p class="changeset-age age">{date|rfc822date}</p>
+    <p class="changeset-age"><span class="age">{date|rfc822date}</span></p>
 
     <dl class="overview">
         <dt>author</dt>
--- a/mercurial/templates/monoblue/filerevision.tmpl	Tue Feb 24 09:08:54 2015 -0800
+++ b/mercurial/templates/monoblue/filerevision.tmpl	Fri Feb 27 17:46:03 2015 -0600
@@ -41,7 +41,7 @@
 
     <h2 class="no-link no-border">{file|escape}@{node|short}</h2>
     <h3 class="changeset">{file|escape}</h3>
-    <p class="changeset-age age">{date|rfc822date}</p>
+    <p class="changeset-age"><span class="age">{date|rfc822date}</span></p>
 
     <dl class="overview">
         <dt>author</dt>
--- a/mercurial/windows.py	Tue Feb 24 09:08:54 2015 -0800
+++ b/mercurial/windows.py	Fri Feb 27 17:46:03 2015 -0600
@@ -167,7 +167,7 @@
         # 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)
--- a/tests/test-extdiff.t	Tue Feb 24 09:08:54 2015 -0800
+++ b/tests/test-extdiff.t	Fri Feb 27 17:46:03 2015 -0600
@@ -182,6 +182,22 @@
   running "*/bin/echo --foo='sp ace' 'sp ace' --bar='sp ace' 'sp ace'" in * (glob)
 #endif
 
+Empty argument must be quoted
+
+  $ cat <<EOF >> $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:
--- a/tests/test-subrepo.t	Tue Feb 24 09:08:54 2015 -0800
+++ b/tests/test-subrepo.t	Fri Feb 27 17:46:03 2015 -0600
@@ -311,6 +311,138 @@
   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 <<EOF
+  > 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 <<EOF
+  > 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 <<EOF
+  > [extensions]
+  > strip=
+  > EOF
+  $ hg strip -r 11:15
+  saved backup bundle to $TESTTMP/t/.hg/strip-backup/*-backup.hg (glob)
+
 clone
 
   $ cd ..