comparison mercurial/context.py @ 25600:70ac1868b707

subrepo: allow a representation of the working directory subrepo Some code cannot handle a subrepo based on the working directory (e.g. sub.dirty()), so the caller must opt in. This will be useful for archive, and perhaps some other commands. The git and svn methods where this is used may need to be fixed up on a case by case basis.
author Matt Harbison <matt_harbison@yahoo.com>
date Tue, 16 Jun 2015 23:03:36 -0400
parents 183965a00c76
children 328739ea70c3
comparison
equal deleted inserted replaced
25599:695b93a79d17 25600:70ac1868b707
247 return self._fileinfo(path)[1] 247 return self._fileinfo(path)[1]
248 except error.LookupError: 248 except error.LookupError:
249 return '' 249 return ''
250 250
251 def sub(self, path): 251 def sub(self, path):
252 '''return a subrepo for the stored revision of path, never wdir()'''
252 return subrepo.subrepo(self, path) 253 return subrepo.subrepo(self, path)
253 254
254 def nullsub(self, path, pctx): 255 def nullsub(self, path, pctx):
255 return subrepo.nullsubrepo(self, path, pctx) 256 return subrepo.nullsubrepo(self, path, pctx)
257
258 def workingsub(self, path):
259 '''return a subrepo for the stored revision, or wdir if this is a wdir
260 context.
261 '''
262 return subrepo.subrepo(self, path, allowwdir=True)
256 263
257 def match(self, pats=[], include=None, exclude=None, default='glob', 264 def match(self, pats=[], include=None, exclude=None, default='glob',
258 listsubrepos=False, badfn=None): 265 listsubrepos=False, badfn=None):
259 r = self._repo 266 r = self._repo
260 return matchmod.match(r.root, r.getcwd(), pats, 267 return matchmod.match(r.root, r.getcwd(), pats,