merge with i18n stable 2.2.2
authorMatt Mackall <mpm@selenic.com>
Fri, 01 Jun 2012 15:14:13 -0500
branchstable
changeset 16827 85a358df5bbb
parent 16814 9da5a2864f3f (diff)
parent 16826 4cf41c333e74 (current diff)
child 16828 8abee656e14c
child 16831 d8ad23e1e2a3
merge with i18n
--- a/mercurial/localrepo.py	Thu May 31 21:47:40 2012 -0300
+++ b/mercurial/localrepo.py	Fri Jun 01 15:14:13 2012 -0500
@@ -833,6 +833,9 @@
                         self.sjoin('phaseroots'))
         self.invalidate()
 
+        # Discard all cache entries to force reloading everything.
+        self._filecache.clear()
+
         parentgone = (parents[0] not in self.changelog.nodemap or
                       parents[1] not in self.changelog.nodemap)
         if parentgone:
@@ -1316,9 +1319,6 @@
         # tag cache retrieval" case to work.
         self.invalidatecaches()
 
-        # Discard all cache entries to force reloading everything.
-        self._filecache.clear()
-
     def walk(self, match, node=None):
         '''
         walk recursively through the directory tree or a given
--- a/mercurial/patch.py	Thu May 31 21:47:40 2012 -0300
+++ b/mercurial/patch.py	Fri Jun 01 15:14:13 2012 -0500
@@ -1343,8 +1343,17 @@
         elif state == 'git':
             for gp in values:
                 path = pstrip(gp.oldpath)
-                data, mode = backend.getfile(path)
-                store.setfile(path, data, mode)
+                try:
+                    data, mode = backend.getfile(path)
+                except IOError, e:
+                    if e.errno != errno.ENOENT:
+                        raise
+                    # The error ignored here will trigger a getfile()
+                    # error in a place more appropriate for error
+                    # handling, and will not interrupt the patching
+                    # process.
+                else:
+                    store.setfile(path, data, mode)
         else:
             raise util.Abort(_('unsupported parser state: %s') % state)
 
--- a/mercurial/scmutil.py	Thu May 31 21:47:40 2012 -0300
+++ b/mercurial/scmutil.py	Fri Jun 01 15:14:13 2012 -0500
@@ -568,7 +568,7 @@
                 newrevs = set(xrange(start, end + step, step))
                 if seen:
                     newrevs.difference_update(seen)
-                    seen.union(newrevs)
+                    seen.update(newrevs)
                 else:
                     seen = newrevs
                 l.extend(sorted(newrevs, reverse=start > end))
--- a/tests/test-mq-missingfiles.t	Thu May 31 21:47:40 2012 -0300
+++ b/tests/test-mq-missingfiles.t	Fri Jun 01 15:14:13 2012 -0500
@@ -73,6 +73,53 @@
   +c
   +c
 
+Test missing renamed file
+
+  $ hg qpop
+  popping changeb
+  patch queue now empty
+  $ hg up -qC 0
+  $ echo a > a
+  $ hg mv b bb
+  $ python ../writelines.py bb 2 'b\n' 10 'a\n' 2 'c\n'
+  $ echo c > c
+  $ hg add a c
+  $ hg qnew changebb
+  $ hg qpop
+  popping changebb
+  patch queue now empty
+  $ hg up -qC 1
+  $ hg qpush
+  applying changebb
+  patching file bb
+  Hunk #1 FAILED at 0
+  Hunk #2 FAILED at 7
+  2 out of 2 hunks FAILED -- saving rejects to file bb.rej
+  b not tracked!
+  patch failed, unable to continue (try -v)
+  patch failed, rejects left in working dir
+  errors during apply, please fix and refresh changebb
+  [2]
+  $ cat a
+  a
+  $ cat c
+  c
+  $ cat bb.rej
+  --- bb
+  +++ bb
+  @@ -1,3 +1,5 @@
+  +b
+  +b
+   a
+   a
+   a
+  @@ -8,3 +10,5 @@
+   a
+   a
+   a
+  +c
+  +c
+
   $ cd ..