Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/context.py @ 19562:389d7767630d
basectx: move sub from changectx
author | Sean Farley <sean.michael.farley@gmail.com> |
---|---|
date | Mon, 05 Aug 2013 18:40:36 -0500 |
parents | 7806e63598b0 |
children | 87503cd824fa |
comparison
equal
deleted
inserted
replaced
19561:7806e63598b0 | 19562:389d7767630d |
---|---|
116 def flags(self, path): | 116 def flags(self, path): |
117 try: | 117 try: |
118 return self._fileinfo(path)[1] | 118 return self._fileinfo(path)[1] |
119 except error.LookupError: | 119 except error.LookupError: |
120 return '' | 120 return '' |
121 | |
122 def sub(self, path): | |
123 return subrepo.subrepo(self, path) | |
121 | 124 |
122 class changectx(basectx): | 125 class changectx(basectx): |
123 """A changecontext object makes access to data related to a particular | 126 """A changecontext object makes access to data related to a particular |
124 changeset convenient. It represents a read-only context already presnt in | 127 changeset convenient. It represents a read-only context already presnt in |
125 the repo.""" | 128 the repo.""" |
377 if fn in self._dirs: | 380 if fn in self._dirs: |
378 # specified pattern is a directory | 381 # specified pattern is a directory |
379 continue | 382 continue |
380 if match.bad(fn, _('no such file in rev %s') % self) and match(fn): | 383 if match.bad(fn, _('no such file in rev %s') % self) and match(fn): |
381 yield fn | 384 yield fn |
382 | |
383 def sub(self, path): | |
384 return subrepo.subrepo(self, path) | |
385 | 385 |
386 def match(self, pats=[], include=None, exclude=None, default='glob'): | 386 def match(self, pats=[], include=None, exclude=None, default='glob'): |
387 r = self._repo | 387 r = self._repo |
388 return matchmod.match(r.root, r.getcwd(), pats, | 388 return matchmod.match(r.root, r.getcwd(), pats, |
389 include, exclude, default, | 389 include, exclude, default, |