3 # Copyright 2009-2010 Matt Mackall <mpm@selenic.com> |
3 # Copyright 2009-2010 Matt Mackall <mpm@selenic.com> |
4 # |
4 # |
5 # This software may be used and distributed according to the terms of the |
5 # This software may be used and distributed according to the terms of the |
6 # GNU General Public License version 2 or any later version. |
6 # GNU General Public License version 2 or any later version. |
7 |
7 |
|
8 import copy |
8 import errno, os, re, shutil, posixpath, sys |
9 import errno, os, re, shutil, posixpath, sys |
9 import xml.dom.minidom |
10 import xml.dom.minidom |
10 import stat, subprocess, tarfile |
11 import stat, subprocess, tarfile |
11 from i18n import _ |
12 from i18n import _ |
12 import config, util, node, error, cmdutil, scmutil, match as matchmod |
13 import config, util, node, error, cmdutil, scmutil, match as matchmod |
622 def add(self, ui, match, dryrun, listsubrepos, prefix, explicitonly): |
623 def add(self, ui, match, dryrun, listsubrepos, prefix, explicitonly): |
623 return cmdutil.add(ui, self._repo, match, dryrun, listsubrepos, |
624 return cmdutil.add(ui, self._repo, match, dryrun, listsubrepos, |
624 os.path.join(prefix, self._path), explicitonly) |
625 os.path.join(prefix, self._path), explicitonly) |
625 |
626 |
626 def addremove(self, m, prefix, opts, dry_run, similarity): |
627 def addremove(self, m, prefix, opts, dry_run, similarity): |
|
628 # In the same way as sub directories are processed, once in a subrepo, |
|
629 # always entry any of its subrepos. Don't corrupt the options that will |
|
630 # be used to process sibling subrepos however. |
|
631 opts = copy.copy(opts) |
|
632 opts['subrepos'] = True |
627 return scmutil.addremove(self._repo, m, |
633 return scmutil.addremove(self._repo, m, |
628 os.path.join(prefix, self._path), opts, |
634 os.path.join(prefix, self._path), opts, |
629 dry_run, similarity) |
635 dry_run, similarity) |
630 |
636 |
631 @annotatesubrepoerror |
637 @annotatesubrepoerror |