mirror of
https://github.com/facebook/sapling.git
synced 2024-10-10 00:45:18 +03:00
test-addremove-similar: use treestate
Summary: The test change is because internal details. In this case, set "mtime" to -1 is more "correct" than "0" (the fixed 1970 date). As we're here, make treestate to normalize size and mtime at "remove" time. This is similar to D8842389 which only affects internal representation, without visible changes affecting users. Reviewed By: DurhamG Differential Revision: D8869841 fbshipit-source-id: 52fce7a230f87dbb41217f4fd2305ff2febe1fdb
This commit is contained in:
parent
39c3ffbbc5
commit
9ed6a30e66
@ -178,6 +178,12 @@ class treestatemap(object):
|
||||
# preserve "copied" information
|
||||
state, mode, size, mtime, copied = existing
|
||||
mode = 0
|
||||
mtime = -1
|
||||
# note: do not reset "size" if it is a special value (ex. -2).
|
||||
# some old code still depends on that. but do reset it since
|
||||
# some tests expect size to be 0.
|
||||
if size > 0:
|
||||
size = 0
|
||||
state ^= state & treestate.EXIST_NEXT
|
||||
else:
|
||||
state = 0
|
||||
|
@ -1,3 +1,4 @@
|
||||
$ setconfig format.dirstate=2
|
||||
$ hg init rep; cd rep
|
||||
|
||||
$ touch empty-file
|
||||
@ -155,7 +156,7 @@ Issue1527: repeated addremove causes Abort
|
||||
adding d/b
|
||||
recording removal of d/a as rename to d/b (100% similar)
|
||||
$ hg debugstate
|
||||
r 0 0 1970-01-01 00:00:00 d/a
|
||||
r 0 0 unset d/a
|
||||
a 0 -1 unset d/b
|
||||
copy: d/a -> d/b
|
||||
$ mv d/b c
|
||||
|
Loading…
Reference in New Issue
Block a user