mercurial/context.py
changeset 41770 c7a843aa4b42
parent 41769 e9413a3be093
child 41776 322ce0bca19d
equal deleted inserted replaced
41769:e9413a3be093 41770:c7a843aa4b42
  1662 
  1662 
  1663     def linkrev(self):
  1663     def linkrev(self):
  1664         # linked to self._changectx no matter if file is modified or not
  1664         # linked to self._changectx no matter if file is modified or not
  1665         return self.rev()
  1665         return self.rev()
  1666 
  1666 
       
  1667     def renamed(self):
       
  1668         path = self.copysource()
       
  1669         if not path:
       
  1670             return None
       
  1671         return path, self._changectx._parents[0]._manifest.get(path, nullid)
       
  1672 
  1667     def parents(self):
  1673     def parents(self):
  1668         '''return parent filectxs, following copies if necessary'''
  1674         '''return parent filectxs, following copies if necessary'''
  1669         def filenode(ctx, path):
  1675         def filenode(ctx, path):
  1670             return ctx._manifest.get(path, nullid)
  1676             return ctx._manifest.get(path, nullid)
  1671 
  1677 
  1698     def _changectx(self):
  1704     def _changectx(self):
  1699         return workingctx(self._repo)
  1705         return workingctx(self._repo)
  1700 
  1706 
  1701     def data(self):
  1707     def data(self):
  1702         return self._repo.wread(self._path)
  1708         return self._repo.wread(self._path)
  1703     def renamed(self):
       
  1704         rp = self.copysource()
       
  1705         if not rp:
       
  1706             return None
       
  1707         return rp, self._changectx._parents[0]._manifest.get(rp, nullid)
       
  1708     def copysource(self):
  1709     def copysource(self):
  1709         return self._repo.dirstate.copied(self._path)
  1710         return self._repo.dirstate.copied(self._path)
  1710 
  1711 
  1711     def size(self):
  1712     def size(self):
  1712         return self._repo.wvfs.lstat(self._path).st_size
  1713         return self._repo.wvfs.lstat(self._path).st_size
  2143     def exists(self):
  2144     def exists(self):
  2144         return self.lexists()
  2145         return self.lexists()
  2145 
  2146 
  2146     def lexists(self):
  2147     def lexists(self):
  2147         return self._parent.exists(self._path)
  2148         return self._parent.exists(self._path)
  2148 
       
  2149     def renamed(self):
       
  2150         path = self.copysource()
       
  2151         if not path:
       
  2152             return None
       
  2153         return path, self._changectx._parents[0]._manifest.get(path, nullid)
       
  2154 
  2149 
  2155     def copysource(self):
  2150     def copysource(self):
  2156         return self._parent.copydata(self._path)
  2151         return self._parent.copydata(self._path)
  2157 
  2152 
  2158     def size(self):
  2153     def size(self):