Mercurial > public > mercurial-scm > hg-stable
diff mercurial/commands.py @ 1712:21dcf38e5d7d
Allow callers to pass in the dirstate lock in most localrepo.py funcs.
This makes it possible to take the lock once and commit a large number of
patches, without having to read and write the dirstate for each patch.
author | mason@suse.com |
---|---|
date | Thu, 09 Feb 2006 17:18:43 -0600 |
parents | c65113f3627a |
children | 55017891051b 284fc722c342 |
line wrap: on
line diff
--- a/mercurial/commands.py Thu Feb 09 17:07:20 2006 -0600 +++ b/mercurial/commands.py Thu Feb 09 17:18:43 2006 -0600 @@ -519,6 +519,9 @@ New files are ignored if they match any of the patterns in .hgignore. As with add, these changes take effect at the next commit. """ + return addremove_lock(ui, repo, pats, opts) + +def addremove_lock(ui, repo, pats, opts, wlock=None): add, remove = [], [] for src, abs, rel, exact in walk(repo, pats, opts): if src == 'f' and repo.dirstate.state(abs) == '?': @@ -529,8 +532,8 @@ remove.append(abs) if ui.verbose or not exact: ui.status(_('removing %s\n') % ((pats and rel) or abs)) - repo.add(add) - repo.remove(remove) + repo.add(add, wlock=wlock) + repo.remove(remove, wlock=wlock) def annotate(ui, repo, *pats, **opts): """show changeset information per file line