# HG changeset patch # User Matt Mackall # Date 1439416910 18000 # Node ID a5f62af2951729db578347fec0c5a52bb3229db9 # Parent 38f92d12357cb8d93576c52d5ed93e771e06ef03# Parent d815a5997576f0ef730e1df2d43c68970643c46b merge with stable diff -r 38f92d12357c -r a5f62af29517 mercurial/match.py --- a/mercurial/match.py Tue Jan 27 11:26:27 2015 -0800 +++ b/mercurial/match.py Wed Aug 12 17:01:50 2015 -0500 @@ -394,7 +394,8 @@ def __init__(self, root, cwd, patterns, include, exclude, default, auditor, ctx, listsubrepos=False, badfn=None): init = super(icasefsmatcher, self).__init__ - self._dsnormalize = ctx.repo().dirstate.normalize + self._dirstate = ctx.repo().dirstate + self._dsnormalize = self._dirstate.normalize init(root, cwd, patterns, include, exclude, default, auditor=auditor, ctx=ctx, listsubrepos=listsubrepos, badfn=badfn) @@ -410,7 +411,13 @@ kindpats = [] for kind, pats, source in self._kp: if kind not in ('re', 'relre'): # regex can't be normalized + p = pats pats = self._dsnormalize(pats) + + # Preserve the original to handle a case only rename. + if p != pats and p in self._dirstate: + kindpats.append((kind, p, source)) + kindpats.append((kind, pats, source)) return kindpats diff -r 38f92d12357c -r a5f62af29517 mercurial/repair.py --- a/mercurial/repair.py Tue Jan 27 11:26:27 2015 -0800 +++ b/mercurial/repair.py Wed Aug 12 17:01:50 2015 -0500 @@ -181,9 +181,8 @@ if troffset == 0: repo.store.markremoved(file) tr.close() - except: # re-raises - tr.abort() - raise + finally: + tr.release() if saveheads or savebases: ui.note(_("adding branch\n")) diff -r 38f92d12357c -r a5f62af29517 tests/test-add.t --- a/tests/test-add.t Tue Jan 27 11:26:27 2015 -0800 +++ b/tests/test-add.t Wed Aug 12 17:01:50 2015 -0500 @@ -232,9 +232,17 @@ -xyz +def + $ hg mv CapsDir1/CapsDir/abc.txt CapsDir1/CapsDir/ABC.txt + moving CapsDir1/CapsDir/AbC.txt to CapsDir1/CapsDir/ABC.txt (glob) + $ hg ci -m "case changing rename" CapsDir1/CapsDir/AbC.txt CapsDir1/CapsDir/ABC.txt + + $ hg status -A capsdir1/capsdir + M CapsDir1/CapsDir/SubDir/Def.txt + C CapsDir1/CapsDir/ABC.txt + $ hg remove -f 'glob:**.txt' -X capsdir1/capsdir $ hg remove -f 'glob:**.txt' -I capsdir1/capsdir - removing CapsDir1/CapsDir/AbC.txt (glob) + removing CapsDir1/CapsDir/ABC.txt (glob) removing CapsDir1/CapsDir/SubDir/Def.txt (glob) #endif diff -r 38f92d12357c -r a5f62af29517 tests/test-strip.t --- a/tests/test-strip.t Tue Jan 27 11:26:27 2015 -0800 +++ b/tests/test-strip.t Wed Aug 12 17:01:50 2015 -0500 @@ -826,3 +826,26 @@ date: Thu Jan 01 00:00:00 1970 +0000 summary: mergeCD + +Error during post-close callback of the strip transaction +(They should be gracefully handled and reported) + + $ cat > ../crashstrip.py << EOF + > from mercurial import error + > def reposetup(ui, repo): + > class crashstriprepo(repo.__class__): + > def transaction(self, desc, *args, **kwargs): + > tr = super(crashstriprepo, self).transaction(self, desc, *args, **kwargs) + > if desc == 'strip': + > def crash(tra): raise error.Abort('boom') + > tr.addpostclose('crash', crash) + > return tr + > repo.__class__ = crashstriprepo + > EOF + $ hg strip tip --config extensions.crash=$TESTTMP/crashstrip.py + saved backup bundle to $TESTTMP/issue4736/.hg/strip-backup/5c51d8d6557d-70daef06-backup.hg (glob) + strip failed, full bundle stored in '$TESTTMP/issue4736/.hg/strip-backup/5c51d8d6557d-70daef06-backup.hg' + abort: boom + [255] + +