##// END OF EJS Templates
context: add copies method with caching
Matt Mackall -
r16602:80aef0bc default
parent child Browse files
Show More
@@ -8,6 +8,7 b''
8 from node import nullid, nullrev, short, hex, bin
8 from node import nullid, nullrev, short, hex, bin
9 from i18n import _
9 from i18n import _
10 import ancestor, mdiff, error, util, scmutil, subrepo, patch, encoding, phases
10 import ancestor, mdiff, error, util, scmutil, subrepo, patch, encoding, phases
11 import copies
11 import match as matchmod
12 import match as matchmod
12 import os, errno, stat
13 import os, errno, stat
13
14
@@ -695,6 +696,14 b' class filectx(object):'
695 c = visit.pop(max(visit))
696 c = visit.pop(max(visit))
696 yield c
697 yield c
697
698
699 def copies(self, c2):
700 if not util.hasattr(self, "_copycache"):
701 self._copycache = {}
702 sc2 = str(c2)
703 if sc2 not in self._copycache:
704 self._copycache[sc2] = copies.pathcopies(c2)
705 return self._copycache[sc2]
706
698 class workingctx(changectx):
707 class workingctx(changectx):
699 """A workingctx object makes access to data related to
708 """A workingctx object makes access to data related to
700 the current working directory convenient.
709 the current working directory convenient.
General Comments 0
You need to be logged in to leave comments. Login now