Mercurial > public > mercurial-scm > hg-stable
diff mercurial/cmdutil.py @ 21832:4b93e19cd6e6
merge with stable
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Wed, 02 Jul 2014 00:01:13 -0500 |
parents | 17d1ac452127 3666331164bb |
children | e353fac7db26 |
line wrap: on
line diff
--- a/mercurial/cmdutil.py Tue Jul 01 19:54:48 2014 -0500 +++ b/mercurial/cmdutil.py Wed Jul 02 00:01:13 2014 -0500 @@ -1944,11 +1944,22 @@ return err -def duplicatecopies(repo, rev, fromrev): - '''reproduce copies from fromrev to rev in the dirstate''' +def duplicatecopies(repo, rev, fromrev, skiprev=None): + '''reproduce copies from fromrev to rev in the dirstate + + If skiprev is specified, it's a revision that should be used to + filter copy records. Any copies that occur between fromrev and + skiprev will not be duplicated, even if they appear in the set of + copies between fromrev and rev. + ''' + exclude = {} + if skiprev is not None: + exclude = copies.pathcopies(repo[fromrev], repo[skiprev]) for dst, src in copies.pathcopies(repo[fromrev], repo[rev]).iteritems(): # copies.pathcopies returns backward renames, so dst might not # actually be in the dirstate + if dst in exclude: + continue if repo.dirstate[dst] in "nma": repo.dirstate.copy(src, dst)