##// END OF EJS Templates
subrepo: introduce getfileset()...
Matt Harbison -
r25121:df63d484 default
parent child Browse files
Show More
@@ -500,6 +500,10 b' class abstractsubrepo(object):'
500 """return file flags"""
500 """return file flags"""
501 return ''
501 return ''
502
502
503 def getfileset(self, expr):
504 """Resolve the fileset expression for this repo"""
505 return set()
506
503 def printfiles(self, ui, m, fm, fmt):
507 def printfiles(self, ui, m, fm, fmt):
504 """handle the files command for this subrepo"""
508 """handle the files command for this subrepo"""
505 return 1
509 return 1
@@ -917,6 +921,26 b' class hgsubrepo(abstractsubrepo):'
917 ctx = self._repo[rev]
921 ctx = self._repo[rev]
918 return cmdutil.files(ui, ctx, m, fm, fmt, True)
922 return cmdutil.files(ui, ctx, m, fm, fmt, True)
919
923
924 @annotatesubrepoerror
925 def getfileset(self, expr):
926 if self._ctx.rev() is None:
927 ctx = self._repo[None]
928 else:
929 rev = self._state[1]
930 ctx = self._repo[rev]
931
932 files = ctx.getfileset(expr)
933
934 for subpath in ctx.substate:
935 sub = ctx.sub(subpath)
936
937 try:
938 files.extend(subpath + '/' + f for f in sub.getfileset(expr))
939 except error.LookupError:
940 self.ui.status(_("skipping missing subrepository: %s\n")
941 % self.wvfs.reljoin(reporelpath(self), subpath))
942 return files
943
920 def walk(self, match):
944 def walk(self, match):
921 ctx = self._repo[None]
945 ctx = self._repo[None]
922 return ctx.walk(match)
946 return ctx.walk(match)
General Comments 0
You need to be logged in to leave comments. Login now