Show More
@@ -1517,6 +1517,10 b' class workingctx(committablectx):' | |||||
1517 | try: |
|
1517 | try: | |
1518 | for f in fixup: |
|
1518 | for f in fixup: | |
1519 | normal(f) |
|
1519 | normal(f) | |
|
1520 | # write changes out explicitly, because nesting | |||
|
1521 | # wlock at runtime may prevent 'wlock.release()' | |||
|
1522 | # below from doing so for subsequent changing files | |||
|
1523 | self._repo.dirstate.write() | |||
1520 | finally: |
|
1524 | finally: | |
1521 | wlock.release() |
|
1525 | wlock.release() | |
1522 | except error.LockError: |
|
1526 | except error.LockError: |
@@ -1008,10 +1008,6 b' largefiles (issue4547)' | |||||
1008 | > EOF |
|
1008 | > EOF | |
1009 | $ hg clone -q enabled-but-no-largefiles no-largefiles |
|
1009 | $ hg clone -q enabled-but-no-largefiles no-largefiles | |
1010 |
|
1010 | |||
1011 | (test rebasing implied by pull: precommit while rebasing unexpectedly |
|
|||
1012 | shows "normal3" as "?", because lfdirstate isn't yet written out at |
|
|||
1013 | that time) |
|
|||
1014 |
|
||||
1015 | $ echo normal2 > enabled-but-no-largefiles/normal2 |
|
1011 | $ echo normal2 > enabled-but-no-largefiles/normal2 | |
1016 | $ hg -R enabled-but-no-largefiles add enabled-but-no-largefiles/normal2 |
|
1012 | $ hg -R enabled-but-no-largefiles add enabled-but-no-largefiles/normal2 | |
1017 |
|
|
1013 | $ hg -R enabled-but-no-largefiles commit -m '#1@enabled-but-no-largefiles' | |
@@ -1026,7 +1022,7 b' that time)' | |||||
1026 |
|
1022 | |||
1027 | $ hg -R no-largefiles -q pull --rebase |
|
1023 | $ hg -R no-largefiles -q pull --rebase | |
1028 | Invoking status precommit hook |
|
1024 | Invoking status precommit hook | |
1029 |
|
|
1025 | A normal3 | |
1030 |
|
1026 | |||
1031 | (test reverting) |
|
1027 | (test reverting) | |
1032 |
|
1028 |
@@ -601,6 +601,17 b' HGMERGE specifies internal:other but is ' | |||||
601 |
|
601 | |||
602 | update is a merge ... |
|
602 | update is a merge ... | |
603 |
|
603 | |||
|
604 | (this also tests that files reverted with '--rev REV' are treated as | |||
|
605 | "modified", even if none of mode, size and timestamp of them isn't | |||
|
606 | changed on the filesystem (see also issue4583)) | |||
|
607 | ||||
|
608 | $ cat >> $HGRCPATH <<EOF | |||
|
609 | > [fakedirstatewritetime] | |||
|
610 | > # emulate invoking dirstate.write() via repo.status() | |||
|
611 | > # at 2000-01-01 00:00 | |||
|
612 | > fakenow = 200001010000 | |||
|
613 | > EOF | |||
|
614 | ||||
604 | $ beforemerge |
|
615 | $ beforemerge | |
605 | [merge-tools] |
|
616 | [merge-tools] | |
606 | false.whatever= |
|
617 | false.whatever= | |
@@ -611,8 +622,16 b' update is a merge ...' | |||||
611 | $ f -s f |
|
622 | $ f -s f | |
612 | f: size=17 |
|
623 | f: size=17 | |
613 | $ touch -t 200001010000 f |
|
624 | $ touch -t 200001010000 f | |
614 | $ hg status f |
|
625 | $ hg debugrebuildstate | |
|
626 | $ cat >> $HGRCPATH <<EOF | |||
|
627 | > [extensions] | |||
|
628 | > fakedirstatewritetime = $TESTDIR/fakedirstatewritetime.py | |||
|
629 | > EOF | |||
615 | $ hg revert -q -r 1 . |
|
630 | $ hg revert -q -r 1 . | |
|
631 | $ cat >> $HGRCPATH <<EOF | |||
|
632 | > [extensions] | |||
|
633 | > fakedirstatewritetime = ! | |||
|
634 | > EOF | |||
616 | $ f -s f |
|
635 | $ f -s f | |
617 | f: size=17 |
|
636 | f: size=17 | |
618 | $ touch -t 200001010000 f |
|
637 | $ touch -t 200001010000 f | |
@@ -646,8 +665,16 b' update should also have --tool' | |||||
646 | $ f -s f |
|
665 | $ f -s f | |
647 | f: size=17 |
|
666 | f: size=17 | |
648 | $ touch -t 200001010000 f |
|
667 | $ touch -t 200001010000 f | |
649 | $ hg status f |
|
668 | $ hg debugrebuildstate | |
|
669 | $ cat >> $HGRCPATH <<EOF | |||
|
670 | > [extensions] | |||
|
671 | > fakedirstatewritetime = $TESTDIR/fakedirstatewritetime.py | |||
|
672 | > EOF | |||
650 | $ hg revert -q -r 1 . |
|
673 | $ hg revert -q -r 1 . | |
|
674 | $ cat >> $HGRCPATH <<EOF | |||
|
675 | > [extensions] | |||
|
676 | > fakedirstatewritetime = ! | |||
|
677 | > EOF | |||
651 | $ f -s f |
|
678 | $ f -s f | |
652 | f: size=17 |
|
679 | f: size=17 | |
653 | $ touch -t 200001010000 f |
|
680 | $ touch -t 200001010000 f |
@@ -206,4 +206,91 b' Test for issue2364' | |||||
206 | $ hg revert -r -2 b |
|
206 | $ hg revert -r -2 b | |
207 | $ hg up -q -- -2 |
|
207 | $ hg up -q -- -2 | |
208 |
|
208 | |||
|
209 | Test that updated files are treated as "modified", when | |||
|
210 | 'merge.update()' is aborted before 'merge.recordupdates()' (= parents | |||
|
211 | aren't changed), even if none of mode, size and timestamp of them | |||
|
212 | isn't changed on the filesystem (see also issue4583). | |||
|
213 | ||||
|
214 | $ cat > $TESTTMP/abort.py <<EOF | |||
|
215 | > # emulate aborting before "recordupdates()". in this case, files | |||
|
216 | > # are changed without updating dirstate | |||
|
217 | > from mercurial import extensions, merge, util | |||
|
218 | > def applyupdates(orig, *args, **kwargs): | |||
|
219 | > orig(*args, **kwargs) | |||
|
220 | > raise util.Abort('intentional aborting') | |||
|
221 | > def extsetup(ui): | |||
|
222 | > extensions.wrapfunction(merge, "applyupdates", applyupdates) | |||
|
223 | > EOF | |||
|
224 | ||||
|
225 | $ cat >> .hg/hgrc <<EOF | |||
|
226 | > [fakedirstatewritetime] | |||
|
227 | > # emulate invoking dirstate.write() via repo.status() | |||
|
228 | > # at 2000-01-01 00:00 | |||
|
229 | > fakenow = 200001010000 | |||
|
230 | > EOF | |||
|
231 | ||||
|
232 | (file gotten from other revision) | |||
|
233 | ||||
|
234 | $ hg update -q -C 2 | |||
|
235 | $ echo 'THIS IS FILE B5' > b | |||
|
236 | $ hg commit -m 'commit #5' | |||
|
237 | ||||
|
238 | $ hg update -q -C 3 | |||
|
239 | $ cat b | |||
|
240 | This is file b1 | |||
|
241 | $ touch -t 200001010000 b | |||
|
242 | $ hg debugrebuildstate | |||
|
243 | ||||
|
244 | $ cat >> .hg/hgrc <<EOF | |||
|
245 | > [extensions] | |||
|
246 | > fakedirstatewritetime = $TESTDIR/fakedirstatewritetime.py | |||
|
247 | > abort = $TESTTMP/abort.py | |||
|
248 | > EOF | |||
|
249 | $ hg merge 5 | |||
|
250 | abort: intentional aborting | |||
|
251 | [255] | |||
|
252 | $ cat >> .hg/hgrc <<EOF | |||
|
253 | > [extensions] | |||
|
254 | > fakedirstatewritetime = ! | |||
|
255 | > abort = ! | |||
|
256 | > EOF | |||
|
257 | ||||
|
258 | $ cat b | |||
|
259 | THIS IS FILE B5 | |||
|
260 | $ touch -t 200001010000 b | |||
|
261 | $ hg status -A b | |||
|
262 | M b | |||
|
263 | ||||
|
264 | (file merged from other revision) | |||
|
265 | ||||
|
266 | $ hg update -q -C 3 | |||
|
267 | $ echo 'this is file b6' > b | |||
|
268 | $ hg commit -m 'commit #6' | |||
|
269 | created new head | |||
|
270 | ||||
|
271 | $ cat b | |||
|
272 | this is file b6 | |||
|
273 | $ touch -t 200001010000 b | |||
|
274 | $ hg debugrebuildstate | |||
|
275 | ||||
|
276 | $ cat >> .hg/hgrc <<EOF | |||
|
277 | > [extensions] | |||
|
278 | > fakedirstatewritetime = $TESTDIR/fakedirstatewritetime.py | |||
|
279 | > abort = $TESTTMP/abort.py | |||
|
280 | > EOF | |||
|
281 | $ hg merge --tool internal:other 5 | |||
|
282 | abort: intentional aborting | |||
|
283 | [255] | |||
|
284 | $ cat >> .hg/hgrc <<EOF | |||
|
285 | > [extensions] | |||
|
286 | > fakedirstatewritetime = ! | |||
|
287 | > abort = ! | |||
|
288 | > EOF | |||
|
289 | ||||
|
290 | $ cat b | |||
|
291 | THIS IS FILE B5 | |||
|
292 | $ touch -t 200001010000 b | |||
|
293 | $ hg status -A b | |||
|
294 | M b | |||
|
295 | ||||
209 | $ cd .. |
|
296 | $ cd .. |
@@ -175,6 +175,46 b' revert of exec bit' | |||||
175 | executable |
|
175 | executable | |
176 | #endif |
|
176 | #endif | |
177 |
|
177 | |||
|
178 | Test that files reverted to other than the parent are treated as | |||
|
179 | "modified", even if none of mode, size and timestamp of it isn't | |||
|
180 | changed on the filesystem (see also issue4583). | |||
|
181 | ||||
|
182 | $ echo 321 > e | |||
|
183 | $ hg diff --git | |||
|
184 | diff --git a/e b/e | |||
|
185 | --- a/e | |||
|
186 | +++ b/e | |||
|
187 | @@ -1,1 +1,1 @@ | |||
|
188 | -123 | |||
|
189 | +321 | |||
|
190 | $ hg commit -m 'ambiguity from size' | |||
|
191 | ||||
|
192 | $ cat e | |||
|
193 | 321 | |||
|
194 | $ touch -t 200001010000 e | |||
|
195 | $ hg debugrebuildstate | |||
|
196 | ||||
|
197 | $ cat >> .hg/hgrc <<EOF | |||
|
198 | > [fakedirstatewritetime] | |||
|
199 | > # emulate invoking dirstate.write() via repo.status() | |||
|
200 | > # at 2000-01-01 00:00 | |||
|
201 | > fakenow = 200001010000 | |||
|
202 | > | |||
|
203 | > [extensions] | |||
|
204 | > fakedirstatewritetime = $TESTDIR/fakedirstatewritetime.py | |||
|
205 | > EOF | |||
|
206 | $ hg revert -r 0 e | |||
|
207 | $ cat >> .hg/hgrc <<EOF | |||
|
208 | > [extensions] | |||
|
209 | > fakedirstatewritetime = ! | |||
|
210 | > EOF | |||
|
211 | ||||
|
212 | $ cat e | |||
|
213 | 123 | |||
|
214 | $ touch -t 200001010000 e | |||
|
215 | $ hg status -A e | |||
|
216 | M e | |||
|
217 | ||||
178 | $ cd .. |
|
218 | $ cd .. | |
179 |
|
219 | |||
180 |
|
220 |
@@ -939,14 +939,32 b' Issue1977: multirepo push should fail if' | |||||
939 |
|
939 | |||
940 | test if untracked file is not overwritten |
|
940 | test if untracked file is not overwritten | |
941 |
|
941 | |||
|
942 | (this also tests that updated .hgsubstate is treated as "modified", | |||
|
943 | when 'merge.update()' is aborted before 'merge.recordupdates()', even | |||
|
944 | if none of mode, size and timestamp of it isn't changed on the | |||
|
945 | filesystem (see also issue4583)) | |||
|
946 | ||||
942 | $ echo issue3276_ok > repo/s/b |
|
947 | $ echo issue3276_ok > repo/s/b | |
943 | $ hg -R repo2 push -f -q |
|
948 | $ hg -R repo2 push -f -q | |
944 | $ touch -t 200001010000 repo/.hgsubstate |
|
949 | $ touch -t 200001010000 repo/.hgsubstate | |
945 | $ hg -R repo status --config debug.dirstate.delaywrite=2 repo/.hgsubstate |
|
950 | ||
|
951 | $ cat >> repo/.hg/hgrc <<EOF | |||
|
952 | > [fakedirstatewritetime] | |||
|
953 | > # emulate invoking dirstate.write() via repo.status() | |||
|
954 | > # at 2000-01-01 00:00 | |||
|
955 | > fakenow = 200001010000 | |||
|
956 | > | |||
|
957 | > [extensions] | |||
|
958 | > fakedirstatewritetime = $TESTDIR/fakedirstatewritetime.py | |||
|
959 | > EOF | |||
946 | $ hg -R repo update |
|
960 | $ hg -R repo update | |
947 | b: untracked file differs |
|
961 | b: untracked file differs | |
948 | abort: untracked files in working directory differ from files in requested revision (in subrepo s) |
|
962 | abort: untracked files in working directory differ from files in requested revision (in subrepo s) | |
949 | [255] |
|
963 | [255] | |
|
964 | $ cat >> repo/.hg/hgrc <<EOF | |||
|
965 | > [extensions] | |||
|
966 | > fakedirstatewritetime = ! | |||
|
967 | > EOF | |||
950 |
|
968 | |||
951 | $ cat repo/s/b |
|
969 | $ cat repo/s/b | |
952 | issue3276_ok |
|
970 | issue3276_ok |
General Comments 0
You need to be logged in to leave comments.
Login now