comparison mercurial/scmutil.py @ 23539:cb42050f2dad

addremove: support addremove with explicit paths in subrepos Git and svn subrepos are currently not supported.
author Matt Harbison <matt_harbison@yahoo.com>
date Sun, 09 Nov 2014 23:46:25 -0500
parents f1b06a8aad42
children aed981c7bebf
comparison
equal deleted inserted replaced
23538:ccfb56450f21 23539:cb42050f2dad
721 similarity = float(opts.get('similarity') or 0) 721 similarity = float(opts.get('similarity') or 0)
722 722
723 ret = 0 723 ret = 0
724 join = lambda f: os.path.join(prefix, f) 724 join = lambda f: os.path.join(prefix, f)
725 725
726 def matchessubrepo(matcher, subpath):
727 if matcher.exact(subpath):
728 return True
729 for f in matcher.files():
730 if f.startswith(subpath):
731 return True
732 return False
733
726 wctx = repo[None] 734 wctx = repo[None]
727 for subpath in sorted(wctx.substate): 735 for subpath in sorted(wctx.substate):
728 if opts.get('subrepos'): 736 if opts.get('subrepos') or matchessubrepo(m, subpath):
729 sub = wctx.sub(subpath) 737 sub = wctx.sub(subpath)
730 try: 738 try:
731 submatch = matchmod.narrowmatcher(subpath, m) 739 submatch = matchmod.narrowmatcher(subpath, m)
732 if sub.addremove(submatch, prefix, opts, dry_run, similarity): 740 if sub.addremove(submatch, prefix, opts, dry_run, similarity):
733 ret = 1 741 ret = 1