mirror of
https://github.com/facebook/sapling.git
synced 2024-10-10 08:47:12 +03:00
b489f6b1c8
Summary: Remove packfile-specific parts of tests and modify them to test without depending on packfiles where possible. Currently debugindexedlogdatastore and debugindexedloghistorystore appear to be broken, and debugdumpindexedlog just dumps the raw indexedlog contents, without any semantic information, so for the time being I've simply removed most packfile inspection. Reviewed By: DurhamG Differential Revision: D29099241 fbshipit-source-id: 86c4f9c83520374560587b8bec5c569d9c5c6510
240 lines
3.5 KiB
Perl
240 lines
3.5 KiB
Perl
#chg-compatible
|
|
|
|
$ disable treemanifest
|
|
Test log FILE history handling with renames / file node collisions.
|
|
|
|
$ . $TESTDIR/library.sh
|
|
|
|
Create a repo with two files X and Y. Create 3 branches (B+E, C, D) where X and
|
|
Y are swapped 0 to 2 times, and merge those branches.
|
|
|
|
$ newrepo nonshallow1
|
|
$ setconfig remotefilelog.server=1
|
|
$ drawdag <<'EOS'
|
|
> H
|
|
> / \
|
|
> F G
|
|
> |\ /|
|
|
> E | | # E/X=2 (copied from Y)
|
|
> | | | # E/Y=2 (copied from X)
|
|
> | | |
|
|
> | | D # D/X=2
|
|
> | | | # D/Y=2
|
|
> | | |
|
|
> | C | # C/X=2 (copied from Y)
|
|
> | | | # C/Y=2 (copied from X)
|
|
> | | |
|
|
> B | | # B/X=2 (copied from Y)
|
|
> | | | # B/Y=2 (copied from X)
|
|
> \|/
|
|
> A # A/X=1
|
|
> # A/Y=1
|
|
> # drawdag.defaultfiles=false
|
|
> EOS
|
|
|
|
$ for i in B C D E H; do
|
|
> echo log via $i:
|
|
> hg log -fr "desc($i)" X -T '{desc}\n' -G
|
|
> done
|
|
log via B:
|
|
o B
|
|
│
|
|
o A
|
|
|
|
log via C:
|
|
o A
|
|
|
|
log via D:
|
|
o D
|
|
│
|
|
o A
|
|
|
|
log via E:
|
|
o E
|
|
│
|
|
o B
|
|
│
|
|
o A
|
|
|
|
log via H:
|
|
o E
|
|
│
|
|
│ o D
|
|
│ │
|
|
o │ B
|
|
├─╯
|
|
o A
|
|
|
|
(incorrect: C disappeared in "log via H" and "log via C")
|
|
|
|
"--removed" does not change things.
|
|
|
|
$ hg log -fr "desc(H)" X -T '{desc}\n' -G
|
|
o E
|
|
│
|
|
│ o D
|
|
│ │
|
|
o │ B
|
|
├─╯
|
|
o A
|
|
|
|
|
|
Try the same on a shallow repo
|
|
|
|
$ hgcloneshallow ssh://user@dummy/nonshallow1 $TESTTMP/shallow1 -q
|
|
* files fetched over * (glob) (?)
|
|
$ cd $TESTTMP/shallow1
|
|
|
|
$ for i in B C D E H; do
|
|
> echo log via $i:
|
|
> hg log -fr "desc($i)" X -T '{desc}\n' -G
|
|
> done
|
|
log via B:
|
|
o B
|
|
│
|
|
o A
|
|
|
|
log via C:
|
|
o C
|
|
│
|
|
o A
|
|
|
|
log via D:
|
|
o D
|
|
│
|
|
o A
|
|
|
|
log via E:
|
|
o E
|
|
│
|
|
o B
|
|
│
|
|
o A
|
|
|
|
log via H:
|
|
o E
|
|
│
|
|
│ o D
|
|
│ │
|
|
│ │ o C
|
|
│ ├─╯
|
|
o │ B
|
|
├─╯
|
|
o A
|
|
|
|
|
|
Test file node collisions created by file delection.
|
|
|
|
Create a repo with one file X. Delete and recreate a few times.
|
|
|
|
$ newrepo nonshallow2
|
|
$ setconfig remotefilelog.server=1
|
|
$ drawdag <<'EOS'
|
|
> G # G/X=
|
|
> |
|
|
> F # F/X=(deleted)
|
|
> |\
|
|
> C E # C/X=
|
|
> | | # E/X=
|
|
> B D # B/X=(deleted)
|
|
> |/ # D/X=(deleted)
|
|
> A # A/X=
|
|
> # drawdag.defaultfiles=false
|
|
> EOS
|
|
|
|
$ for i in A C E G; do
|
|
> echo log via $i:
|
|
> hg log -fr "desc($i)" X -T '{desc}\n' -G
|
|
> done
|
|
log via A:
|
|
o A
|
|
|
|
log via C:
|
|
o C
|
|
│
|
|
o B
|
|
│
|
|
o A
|
|
|
|
log via E:
|
|
o A
|
|
|
|
log via G:
|
|
o G
|
|
├─╮
|
|
╷ o C
|
|
╷ │
|
|
╷ o B
|
|
╭─╯
|
|
o A
|
|
|
|
(incorrect: D, E disappeared in "log via E" and "log via G"; F disappeared in "log via G")
|
|
|
|
With "--removed", it is slightly better.
|
|
|
|
$ hg log -fr "desc(G)" X -T '{desc}\n' -G --removed
|
|
o G
|
|
├─╮
|
|
╷ o C
|
|
╷ │
|
|
o │ D
|
|
│ │
|
|
│ o B
|
|
├─╯
|
|
o A
|
|
|
|
|
|
Try again in a shallow repo:
|
|
|
|
$ hgcloneshallow ssh://user@dummy/nonshallow2 $TESTTMP/shallow2 -q
|
|
* files fetched over * (glob) (?)
|
|
$ cd $TESTTMP/shallow2
|
|
|
|
$ for i in A C E G; do
|
|
> echo log via $i:
|
|
> hg log -fr "desc($i)" X -T '{desc}\n' -G
|
|
> done
|
|
log via A:
|
|
o A
|
|
|
|
log via C:
|
|
o C
|
|
│
|
|
o B
|
|
│
|
|
o A
|
|
|
|
log via E:
|
|
o D
|
|
│
|
|
o A
|
|
|
|
log via G:
|
|
@ G
|
|
├─╮
|
|
╷ o C
|
|
╷ │
|
|
o │ D
|
|
│ │
|
|
│ o B
|
|
├─╯
|
|
o A
|
|
|
|
(incorrect: E disappeared in "log via E" and "log via G"; F disappeared in "log via G")
|
|
|
|
"--removed" does not change things.
|
|
|
|
$ hg log -fr "desc(G)" X -T '{desc}\n' -G --removed
|
|
@ G
|
|
├─╮
|
|
╷ o C
|
|
╷ │
|
|
o │ D
|
|
│ │
|
|
│ o B
|
|
├─╯
|
|
o A
|
|
|
|
|
|
# trailing whitespace
|