Mercurial > hg
comparison mercurial/cmdutil.py @ 22901:722117c8e023
duplicatecopies: move from cmdutil to copies
This is in preparation for moving its primary caller into merge.py,
which would be a layering violation in the current location.
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Mon, 13 Oct 2014 14:33:13 -0500 |
parents | cd43195ef876 |
children | 6c86c673dde6 |
comparison
equal
deleted
inserted
replaced
22900:7bf82faba774 | 22901:722117c8e023 |
---|---|
2103 ui.status(_("skipping missing subrepository: %s\n") | 2103 ui.status(_("skipping missing subrepository: %s\n") |
2104 % os.path.join(prefix, subpath)) | 2104 % os.path.join(prefix, subpath)) |
2105 | 2105 |
2106 return err | 2106 return err |
2107 | 2107 |
2108 def duplicatecopies(repo, rev, fromrev, skiprev=None): | |
2109 '''reproduce copies from fromrev to rev in the dirstate | |
2110 | |
2111 If skiprev is specified, it's a revision that should be used to | |
2112 filter copy records. Any copies that occur between fromrev and | |
2113 skiprev will not be duplicated, even if they appear in the set of | |
2114 copies between fromrev and rev. | |
2115 ''' | |
2116 exclude = {} | |
2117 if skiprev is not None: | |
2118 exclude = copies.pathcopies(repo[fromrev], repo[skiprev]) | |
2119 for dst, src in copies.pathcopies(repo[fromrev], repo[rev]).iteritems(): | |
2120 # copies.pathcopies returns backward renames, so dst might not | |
2121 # actually be in the dirstate | |
2122 if dst in exclude: | |
2123 continue | |
2124 if repo.dirstate[dst] in "nma": | |
2125 repo.dirstate.copy(src, dst) | |
2126 | |
2127 def commit(ui, repo, commitfunc, pats, opts): | 2108 def commit(ui, repo, commitfunc, pats, opts): |
2128 '''commit the specified files or all outstanding changes''' | 2109 '''commit the specified files or all outstanding changes''' |
2129 date = opts.get('date') | 2110 date = opts.get('date') |
2130 if date: | 2111 if date: |
2131 opts['date'] = util.parsedate(date) | 2112 opts['date'] = util.parsedate(date) |