Show More
@@ -2338,6 +2338,14 b' def revert(ui, repo, *pats, **opts):' | |||||
2338 | changes = repo.status(match=names.has_key, wlock=wlock)[:5] |
|
2338 | changes = repo.status(match=names.has_key, wlock=wlock)[:5] | |
2339 | modified, added, removed, deleted, unknown = map(dict.fromkeys, changes) |
|
2339 | modified, added, removed, deleted, unknown = map(dict.fromkeys, changes) | |
2340 |
|
2340 | |||
|
2341 | # if f is a rename, also revert the source | |||
|
2342 | cwd = repo.getcwd() | |||
|
2343 | for f in added: | |||
|
2344 | src = repo.dirstate.copied(f) | |||
|
2345 | if src and src not in names and repo.dirstate[src][0] == 'r': | |||
|
2346 | removed[src] = None | |||
|
2347 | names[src] = (repo.pathto(src, cwd), True) | |||
|
2348 | ||||
2341 | revert = ([], _('reverting %s\n')) |
|
2349 | revert = ([], _('reverting %s\n')) | |
2342 | add = ([], _('adding %s\n')) |
|
2350 | add = ([], _('adding %s\n')) | |
2343 | remove = ([], _('removing %s\n')) |
|
2351 | remove = ([], _('removing %s\n')) |
General Comments 0
You need to be logged in to leave comments.
Login now