comparison mercurial/subrepo.py @ 15912:2bd54ffaa27e

forget: fix subrepo recursion for explicit path handling When support for handling explicit paths in subrepos was added to the forget command (95174c381525), subrepo recursion wasn't taken into account. This change fixes that by pulling the majority of the logic of commands.forget into cmdutil.forget, which can then be called from both there and subrepo.forget.
author David M. Carr <david@carrclan.us>
date Tue, 17 Jan 2012 19:10:59 -0500
parents c654eac03452
children 04604d1a9fc3
comparison
equal deleted inserted replaced
15911:c654eac03452 15912:2bd54ffaa27e
358 walk recursively through the directory tree, finding all files 358 walk recursively through the directory tree, finding all files
359 matched by the match function 359 matched by the match function
360 ''' 360 '''
361 pass 361 pass
362 362
363 def forget(self, files): 363 def forget(self, ui, match, prefix):
364 pass 364 return []
365 365
366 class hgsubrepo(abstractsubrepo): 366 class hgsubrepo(abstractsubrepo):
367 def __init__(self, ctx, path, state): 367 def __init__(self, ctx, path, state):
368 self._path = path 368 self._path = path
369 self._state = state 369 self._state = state
559 559
560 def walk(self, match): 560 def walk(self, match):
561 ctx = self._repo[None] 561 ctx = self._repo[None]
562 return ctx.walk(match) 562 return ctx.walk(match)
563 563
564 def forget(self, files): 564 def forget(self, ui, match, prefix):
565 ctx = self._repo[None] 565 return cmdutil.forget(ui, self._repo, match,
566 ctx.forget(files) 566 os.path.join(prefix, self._path), True)
567 567
568 class svnsubrepo(abstractsubrepo): 568 class svnsubrepo(abstractsubrepo):
569 def __init__(self, ctx, path, state): 569 def __init__(self, ctx, path, state):
570 self._path = path 570 self._path = path
571 self._state = state 571 self._state = state