Show More
@@ -735,8 +735,10 b' def remove(ui, repo, file, *files):' | |||||
735 |
|
735 | |||
736 | def revert(ui, repo, *names, **opts): |
|
736 | def revert(ui, repo, *names, **opts): | |
737 | """revert modified files or dirs back to their unmodified states""" |
|
737 | """revert modified files or dirs back to their unmodified states""" | |
738 |
node = opts['rev'] and repo.lookup(opts['rev']) or |
|
738 | node = opts['rev'] and repo.lookup(opts['rev']) or \ | |
|
739 | repo.dirstate.parents()[0] | |||
739 | root = os.path.realpath(repo.root) |
|
740 | root = os.path.realpath(repo.root) | |
|
741 | ||||
740 | def trimpath(p): |
|
742 | def trimpath(p): | |
741 | p = os.path.realpath(p) |
|
743 | p = os.path.realpath(p) | |
742 | if p.startswith(root): |
|
744 | if p.startswith(root): | |
@@ -746,8 +748,10 b' def revert(ui, repo, *names, **opts):' | |||||
746 | if p.startswith(os.sep): |
|
748 | if p.startswith(os.sep): | |
747 | return rest[1:] |
|
749 | return rest[1:] | |
748 | return p |
|
750 | return p | |
|
751 | ||||
749 | relnames = map(trimpath, names or [os.getcwd()]) |
|
752 | relnames = map(trimpath, names or [os.getcwd()]) | |
750 | chosen = {} |
|
753 | chosen = {} | |
|
754 | ||||
751 | def choose(name): |
|
755 | def choose(name): | |
752 | def body(name): |
|
756 | def body(name): | |
753 | for r in relnames: |
|
757 | for r in relnames: |
General Comments 0
You need to be logged in to leave comments.
Login now