mercurial/context.py
branchstable
changeset 16143 fceb2964fa6c
parent 16111 131d1a09108a
child 16145 616c2e278f18
equal deleted inserted replaced
16141:f346de4dff57 16143:fceb2964fa6c
   234             ctx2 = self._repo[ctx2]
   234             ctx2 = self._repo[ctx2]
   235         diffopts = patch.diffopts(self._repo.ui, opts)
   235         diffopts = patch.diffopts(self._repo.ui, opts)
   236         return patch.diff(self._repo, ctx2.node(), self.node(),
   236         return patch.diff(self._repo, ctx2.node(), self.node(),
   237                           match=match, opts=diffopts)
   237                           match=match, opts=diffopts)
   238 
   238 
       
   239     @propertycache
       
   240     def _dirs(self):
       
   241         dirs = set()
       
   242         for f in self._manifest:
       
   243             pos = f.rfind('/')
       
   244             while pos != -1:
       
   245                 f = f[:pos]
       
   246                 if f in dirs:
       
   247                     break # dirs already contains this and above
       
   248                 dirs.add(f)
       
   249                 pos = f.rfind('/')
       
   250         return dirs
       
   251 
       
   252     def dirs(self):
       
   253         return self._dirs
       
   254 
   239 class filectx(object):
   255 class filectx(object):
   240     """A filecontext object makes access to data related to a particular
   256     """A filecontext object makes access to data related to a particular
   241        filerevision convenient."""
   257        filerevision convenient."""
   242     def __init__(self, repo, path, changeid=None, fileid=None,
   258     def __init__(self, repo, path, changeid=None, fileid=None,
   243                  filelog=None, changectx=None):
   259                  filelog=None, changectx=None):
   951                     self._repo.dirstate.add(dest)
   967                     self._repo.dirstate.add(dest)
   952                 self._repo.dirstate.copy(source, dest)
   968                 self._repo.dirstate.copy(source, dest)
   953             finally:
   969             finally:
   954                 wlock.release()
   970                 wlock.release()
   955 
   971 
       
   972     def dirs(self):
       
   973         return self._repo.dirstate.dirs()
       
   974 
   956 class workingfilectx(filectx):
   975 class workingfilectx(filectx):
   957     """A workingfilectx object makes access to data related to a particular
   976     """A workingfilectx object makes access to data related to a particular
   958        file in the working directory convenient."""
   977        file in the working directory convenient."""
   959     def __init__(self, repo, path, filelog=None, workingctx=None):
   978     def __init__(self, repo, path, filelog=None, workingctx=None):
   960         """changeid can be a changeset revision, node, or tag.
   979         """changeid can be a changeset revision, node, or tag.