Mercurial > public > mercurial-scm > hg
comparison mercurial/cmdutil.py @ 19129:bd19587a3347 stable
revert: ensure that copies and renames are honored (issue3920)
Previously, we restored the states of files, but not the additional
information the dirstate uses to track copies and renames.
author | Bryan O'Sullivan <bryano@fb.com> |
---|---|
date | Fri, 03 May 2013 12:40:17 -0700 |
parents | ab04e87a5f3b |
children | 3bfd7f1e7485 |
comparison
equal
deleted
inserted
replaced
19128:f4930b533d55 | 19129:bd19587a3347 |
---|---|
2053 normal = repo.dirstate.normal | 2053 normal = repo.dirstate.normal |
2054 for f in undelete[0]: | 2054 for f in undelete[0]: |
2055 checkout(f) | 2055 checkout(f) |
2056 normal(f) | 2056 normal(f) |
2057 | 2057 |
2058 copied = copies.pathcopies(repo[parent], ctx) | |
2059 | |
2060 for f in add[0] + undelete[0] + revert[0]: | |
2061 if f in copied: | |
2062 repo.dirstate.copy(copied[f], f) | |
2063 | |
2058 if targetsubs: | 2064 if targetsubs: |
2059 # Revert the subrepos on the revert list | 2065 # Revert the subrepos on the revert list |
2060 for sub in targetsubs: | 2066 for sub in targetsubs: |
2061 ctx.sub(sub).revert(ui, ctx.substate[sub], *pats, **opts) | 2067 ctx.sub(sub).revert(ui, ctx.substate[sub], *pats, **opts) |
2062 finally: | 2068 finally: |