diff --git a/i18n/pt_BR.po b/i18n/pt_BR.po --- a/i18n/pt_BR.po +++ b/i18n/pt_BR.po @@ -22581,6 +22581,9 @@ msgstr "o caminho %r percorre o link simbólico %r" msgid "could not symlink to %r: %s" msgstr "impossível criar link simbólico para %r: %s" +msgid "empty revision range" +msgstr "faixa de revisões vazia" + #, python-format msgid "recording removal of %s as rename to %s (%d%% similar)\n" msgstr "gravando remoção de %s como renomeação para %s (%d%% de similaridade)\n" diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -838,6 +838,9 @@ class localrepository(repo.repository): 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: @@ -1320,9 +1323,6 @@ class localrepository(repo.repository): # 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 diff --git a/mercurial/patch.py b/mercurial/patch.py --- a/mercurial/patch.py +++ b/mercurial/patch.py @@ -1345,8 +1345,17 @@ def _applydiff(ui, fp, patcher, backend, 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) diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py --- a/mercurial/scmutil.py +++ b/mercurial/scmutil.py @@ -569,7 +569,7 @@ def revrange(repo, revs): 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)) diff --git a/tests/test-mq-missingfiles.t b/tests/test-mq-missingfiles.t --- a/tests/test-mq-missingfiles.t +++ b/tests/test-mq-missingfiles.t @@ -73,6 +73,53 @@ Display rejections: +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 ..