##// END OF EJS Templates
revert: use modified information from both statuses...
Pierre-Yves David -
r22190:55308ab8 default
parent child Browse files
Show More
@@ -2408,7 +2408,6 b' def revert(ui, repo, ctx, parents, *pats'
2408 2408 dsadded = set(changes[1])
2409 2409 dsremoved = set(changes[2])
2410 2410 dsadded |= _deletedadded
2411 dsmodified |= _deletedmodified
2412 2411
2413 2412 # only take into account for removes between wc and target
2414 2413 clean |= dsremoved - removed
@@ -2416,6 +2415,11 b' def revert(ui, repo, ctx, parents, *pats'
2416 2415 # distinct between dirstate remove and other
2417 2416 removed -= dsremoved
2418 2417
2418 # tell newly modified apart.
2419 dsmodified &= modified
2420 dsmodified |= modified & dsadded # dirstate added may needs backup
2421 modified -= dsmodified
2422
2419 2423 # if f is a rename, update `names` to also revert the source
2420 2424 cwd = repo.getcwd()
2421 2425 for f in dsadded:
@@ -2448,6 +2452,7 b' def revert(ui, repo, ctx, parents, *pats'
2448 2452 # file state
2449 2453 # action
2450 2454 # make backup
2455 (modified, (actions['revert'], False)),
2451 2456 (dsmodified, (actions['revert'], True)),
2452 2457 (missingmodified, (actions['remove'], True)),
2453 2458 (dsadded, (actions['revert'], True)),
@@ -1496,7 +1496,6 b' revert some files to an older revision'
1496 1496 $ cat sub2/large6
1497 1497 large6
1498 1498 $ hg revert --no-backup -C -r '.^' sub2
1499 reverting .hglf/sub2/large6 (glob)
1500 1499 $ hg revert --no-backup sub2
1501 1500 reverting .hglf/sub2/large6 (glob)
1502 1501 $ hg status
@@ -912,7 +912,6 b' Misbehavior:'
912 912
913 913 - report "reverting" when file needs no changes
914 914 |
915 | - reverting modified_revert
916 915 | - reverting removed_revert
917 916
918 917 $ hg revert --all --rev 'desc(base)'
@@ -930,7 +929,6 b' Misbehavior:'
930 929 reverting modified_clean
931 930 reverting modified_deleted
932 931 undeleting modified_removed
933 reverting modified_revert
934 932 undeleting modified_untracked-clean
935 933 undeleting modified_untracked-revert
936 934 undeleting modified_untracked-wc
@@ -1104,7 +1102,6 b' Misbehavior:'
1104 1102
1105 1103 - fails to report no change to revert for
1106 1104 |
1107 | - modified_revert
1108 1105 | - removed_revert
1109 1106
1110 1107 $ for file in `python ../gen-revert-cases.py filelist`; do
@@ -1180,6 +1177,7 b' Misbehavior:'
1180 1177 ### revert for: modified_removed
1181 1178
1182 1179 ### revert for: modified_revert
1180 no changes needed to modified_revert
1183 1181
1184 1182 ### revert for: modified_untracked-clean
1185 1183
General Comments 0
You need to be logged in to leave comments. Login now