comparison hgext/narrow/narrowrepo.py @ 38128:1cba497491be

narrow: only wrap dirstate functions once, instead of per-reposetup chg will call reposetup multiple times, and we would end up double-wrapping (or worse) the dirstate functions; this can cause issues like OSError 'No such file or directory' during rebase operations, when we go to double-delete our narrowspec backup file. Differential Revision: https://phab.mercurial-scm.org/D3559
author Kyle Lippincott <spectral@google.com>
date Wed, 16 May 2018 14:59:32 -0700
parents c3c76194f0c1
children e411774a2e0f
comparison
equal deleted inserted replaced
38127:b7e5c53a779e 38128:1cba497491be
13 narrowspec, 13 narrowspec,
14 scmutil, 14 scmutil,
15 ) 15 )
16 16
17 from . import ( 17 from . import (
18 narrowdirstate,
18 narrowrevlog, 19 narrowrevlog,
19 ) 20 )
20 21
21 def wrappostshare(orig, sourcerepo, destrepo, **kwargs): 22 def wrappostshare(orig, sourcerepo, destrepo, **kwargs):
22 orig(sourcerepo, destrepo, **kwargs) 23 orig(sourcerepo, destrepo, **kwargs)
60 ignored = list(filter(narrowmatch, s.ignored)) 61 ignored = list(filter(narrowmatch, s.ignored))
61 clean = list(filter(narrowmatch, s.clean)) 62 clean = list(filter(narrowmatch, s.clean))
62 return scmutil.status(modified, added, removed, deleted, unknown, 63 return scmutil.status(modified, added, removed, deleted, unknown,
63 ignored, clean) 64 ignored, clean)
64 65
66 def _makedirstate(self):
67 dirstate = super(narrowrepository, self)._makedirstate()
68 return narrowdirstate.wrapdirstate(self, dirstate)
69
65 repo.__class__ = narrowrepository 70 repo.__class__ = narrowrepository