comparison mercurial/subrepo.py @ 15410:9e99d2bbb1b1

add: support adding explicit files in subrepos Change the behavior of the add command such that explicit paths in subrepos are always added. This eliminates the previous behavior where if you called "hg add" for an explicit path in a subrepo without specifying the -S option, it would be silently ignored. If you specify patterns, or no arguments at all, the -S option will still be needed to activate recursion into subrepos.
author David M. Carr <david@carrclan.us>
date Wed, 02 Nov 2011 01:17:11 -0400
parents b3e19c355ca7
children 95174c381525
comparison
equal deleted inserted replaced
15409:83c2e6772408 15410:9e99d2bbb1b1
351 mode, symlink, self.filedata(name)) 351 mode, symlink, self.filedata(name))
352 ui.progress(_('archiving (%s)') % relpath, i + 1, 352 ui.progress(_('archiving (%s)') % relpath, i + 1,
353 unit=_('files'), total=total) 353 unit=_('files'), total=total)
354 ui.progress(_('archiving (%s)') % relpath, None) 354 ui.progress(_('archiving (%s)') % relpath, None)
355 355
356 def walk(self, match):
357 '''
358 walk recursively through the directory tree, finding all files
359 matched by the match function
360 '''
361 pass
356 362
357 class hgsubrepo(abstractsubrepo): 363 class hgsubrepo(abstractsubrepo):
358 def __init__(self, ctx, path, state): 364 def __init__(self, ctx, path, state):
359 self._path = path 365 self._path = path
360 self._state = state 366 self._state = state
541 def fileflags(self, name): 547 def fileflags(self, name):
542 rev = self._state[1] 548 rev = self._state[1]
543 ctx = self._repo[rev] 549 ctx = self._repo[rev]
544 return ctx.flags(name) 550 return ctx.flags(name)
545 551
552 def walk(self, match):
553 ctx = self._repo[None]
554 return ctx.walk(match)
546 555
547 class svnsubrepo(abstractsubrepo): 556 class svnsubrepo(abstractsubrepo):
548 def __init__(self, ctx, path, state): 557 def __init__(self, ctx, path, state):
549 self._path = path 558 self._path = path
550 self._state = state 559 self._state = state