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