# HG changeset patch # User Sean Farley # Date 1376280370 18000 # Node ID bae0493b6dc05ecf08c94aca5ca0431cb39818fc # Parent 0670422d58c6b08a755fdf3f080d9d089b4e91a6 basefilectx: move copies from filectx diff -r 0670422d58c6 -r bae0493b6dc0 mercurial/context.py --- a/mercurial/context.py Sun Aug 11 23:05:50 2013 -0500 +++ b/mercurial/context.py Sun Aug 11 23:06:10 2013 -0500 @@ -722,6 +722,14 @@ c = visit.pop(max(visit)) yield c + def copies(self, c2): + if not util.safehasattr(self, "_copycache"): + self._copycache = {} + sc2 = str(c2) + if sc2 not in self._copycache: + self._copycache[sc2] = copies.pathcopies(c2) + return self._copycache[sc2] + class filectx(basefilectx): """A filecontext object makes access to data related to a particular filerevision convenient.""" @@ -813,14 +821,6 @@ return [filectx(self._repo, self._path, fileid=x, filelog=self._filelog) for x in c] - def copies(self, c2): - if not util.safehasattr(self, "_copycache"): - self._copycache = {} - sc2 = str(c2) - if sc2 not in self._copycache: - self._copycache[sc2] = copies.pathcopies(c2) - return self._copycache[sc2] - class workingctx(basectx): """A workingctx object makes access to data related to the current working directory convenient.