##// END OF EJS Templates
context: add specialized way of getting copy source file only...
Martin von Zweigbergk -
r41934:041d8295 default
parent child Browse files
Show More
@@ -136,6 +136,10 b' class remotefilectx(context.filectx):'
136 136 pass
137 137 return renamed
138 138
139 def copysource(self):
140 copy = self.renamed()
141 return copy and copy[0]
142
139 143 def ancestormap(self):
140 144 if not self._ancestormap:
141 145 self._ancestormap = self.filelog().ancestormap(self._filenode)
@@ -691,6 +691,8 b' class basefilectx(object):'
691 691 return self._changectx
692 692 def renamed(self):
693 693 return self._copied
694 def copysource(self):
695 return self._copied and self._copied[0]
694 696 def repo(self):
695 697 return self._repo
696 698 def size(self):
@@ -1703,6 +1705,8 b' class workingfilectx(committablefilectx)'
1703 1705 if not rp:
1704 1706 return None
1705 1707 return rp, self._changectx._parents[0]._manifest.get(rp, nullid)
1708 def copysource(self):
1709 return self._repo.dirstate.copied(self._path)
1706 1710
1707 1711 def size(self):
1708 1712 return self._repo.wvfs.lstat(self._path).st_size
@@ -2148,6 +2152,9 b' class overlayworkingfilectx(committablef'
2148 2152 return None
2149 2153 return path, self._changectx._parents[0]._manifest.get(path, nullid)
2150 2154
2155 def copysource(self):
2156 return self._parent.copydata(self._path)
2157
2151 2158 def size(self):
2152 2159 return self._parent.size(self._path)
2153 2160
General Comments 0
You need to be logged in to leave comments. Login now