2017-08-11 03:54:18 +03:00
|
|
|
#require p4
|
|
|
|
|
|
|
|
$ . $TESTDIR/p4setup.sh
|
|
|
|
$ cat >> $HGRCPATH<<EOF
|
|
|
|
> [extensions]
|
2018-01-11 02:36:54 +03:00
|
|
|
> lfs=
|
2017-08-11 03:54:18 +03:00
|
|
|
> [p4fastimport]
|
|
|
|
> lfspointeronly=True
|
|
|
|
> lfsmetadata=lfs.sql
|
|
|
|
> [lfs]
|
|
|
|
> threshold=10
|
|
|
|
> EOF
|
|
|
|
|
2018-02-06 02:23:25 +03:00
|
|
|
$ p4 client -o hg-p4-import-narrow | sed '/^View:/,$ d' >p4client
|
|
|
|
$ echo "View:" >>p4client
|
|
|
|
$ echo " //depot/Main/... //hg-p4-import-narrow/Main/..." >>p4client
|
|
|
|
$ p4 client -i <p4client
|
|
|
|
Client hg-p4-import-narrow saved.
|
|
|
|
|
2017-08-11 03:54:18 +03:00
|
|
|
populate the depot
|
|
|
|
$ mkdir Main
|
|
|
|
$ echo a > Main/a
|
|
|
|
$ echo thisisasuperlargefilebewithmorethank10ksize >> Main/largefile
|
|
|
|
$ p4 add Main/a Main/largefile
|
|
|
|
//depot/Main/a#1 - opened for add
|
|
|
|
//depot/Main/largefile#1 - opened for add
|
|
|
|
$ p4 submit -d initial
|
|
|
|
Submitting change 1.
|
|
|
|
Locking 2 files ...
|
|
|
|
add //depot/Main/a#1
|
|
|
|
add //depot/Main/largefile#1
|
|
|
|
Change 1 submitted.
|
|
|
|
|
|
|
|
$ p4 edit Main/a Main/largefile
|
|
|
|
//depot/Main/a#1 - opened for edit
|
|
|
|
//depot/Main/largefile#1 - opened for edit
|
|
|
|
$ echo a >> Main/a
|
|
|
|
$ echo thisisasuperlargefilebewithmorethank10ksize >> Main/largefile
|
|
|
|
$ p4 submit -d second
|
|
|
|
Submitting change 2.
|
|
|
|
Locking 2 files ...
|
|
|
|
edit //depot/Main/a#2
|
|
|
|
edit //depot/Main/largefile#2
|
|
|
|
Change 2 submitted.
|
|
|
|
|
2017-10-10 20:14:00 +03:00
|
|
|
Sync Commit
|
2017-08-11 03:54:18 +03:00
|
|
|
|
|
|
|
$ cd $hgwd
|
|
|
|
$ hg init --config 'format.usefncache=False'
|
2018-04-19 02:56:36 +03:00
|
|
|
$ hg p4seqimport --debug -P $P4ROOT hg-p4-import-narrow
|
2017-08-11 03:54:18 +03:00
|
|
|
loading changelist numbers.
|
|
|
|
2 changelists to import.
|
2018-04-19 02:56:36 +03:00
|
|
|
importing CL1
|
|
|
|
committing files:
|
|
|
|
Main/a
|
|
|
|
file: //depot/Main/a, src: * (glob)
|
|
|
|
Main/largefile
|
|
|
|
file: //depot/Main/largefile, src: * (glob)
|
|
|
|
committing manifest
|
|
|
|
committing changelog
|
2017-08-11 03:54:18 +03:00
|
|
|
largefile: Main/largefile, oid: 37a7b43abd9e105a0e6b22088b140735a02f288767fe7a6f4f436cb46b064ca9
|
2018-04-19 02:56:36 +03:00
|
|
|
writing lfs metadata to sqlite
|
|
|
|
importing CL2
|
2018-04-19 22:06:09 +03:00
|
|
|
file: //depot/Main/a, src: * (glob)
|
|
|
|
file: //depot/Main/largefile, src: * (glob)
|
2018-04-19 02:56:36 +03:00
|
|
|
committing files:
|
|
|
|
Main/a
|
|
|
|
Main/largefile
|
|
|
|
committing manifest
|
|
|
|
committing changelog
|
2017-08-11 03:54:18 +03:00
|
|
|
largefile: Main/largefile, oid: b0d5c1968efbabbff9d94160f284cd7b52686ca3c46cfffdd351de07384fce9c
|
|
|
|
writing lfs metadata to sqlite
|
|
|
|
updating the branch cache
|
2018-04-19 02:56:36 +03:00
|
|
|
|
2018-02-06 02:23:25 +03:00
|
|
|
|
2017-08-11 03:54:18 +03:00
|
|
|
$ cd $p4wd
|
2018-02-06 02:23:25 +03:00
|
|
|
$ mkdir Outside
|
2018-04-24 02:09:13 +03:00
|
|
|
$ echo b > Outside/b
|
2018-02-06 02:23:25 +03:00
|
|
|
$ echo thisisanotherlargefile > Outside/anotherlargefile
|
2018-04-24 02:09:13 +03:00
|
|
|
$ p4 add Outside/b Outside/anotherlargefile
|
|
|
|
//depot/Outside/b#1 - opened for add
|
2018-02-06 02:23:25 +03:00
|
|
|
//depot/Outside/anotherlargefile#1 - opened for add
|
2017-08-11 03:54:18 +03:00
|
|
|
$ p4 submit -d third
|
|
|
|
Submitting change 3.
|
2018-04-24 02:09:13 +03:00
|
|
|
Locking 2 files ...
|
2018-02-06 02:23:25 +03:00
|
|
|
add //depot/Outside/anotherlargefile#1
|
2018-04-24 02:09:13 +03:00
|
|
|
add //depot/Outside/b#1
|
2017-08-11 03:54:18 +03:00
|
|
|
Change 3 submitted.
|
2018-02-06 02:23:25 +03:00
|
|
|
|
2017-08-11 03:54:18 +03:00
|
|
|
$ cd $hgwd
|
2018-02-06 02:23:25 +03:00
|
|
|
$ hg p4syncimport --debug -P $P4ROOT hg-p4-import-narrow hg-p4-import
|
2017-08-11 03:54:18 +03:00
|
|
|
incremental import from changelist: 3, node: * (glob)
|
2018-02-06 02:23:25 +03:00
|
|
|
2 (current client) 3 (requested client) 2 (latest imported)
|
|
|
|
latest change list number 3
|
2018-04-27 17:59:33 +03:00
|
|
|
2 added files
|
|
|
|
0 removed files
|
2018-04-24 02:09:13 +03:00
|
|
|
committing files:
|
|
|
|
Outside/anotherlargefile
|
|
|
|
file: //depot/Outside/anotherlargefile, src: * (glob)
|
|
|
|
Outside/b
|
|
|
|
file: //depot/Outside/b, src: * (glob)
|
|
|
|
committing manifest
|
|
|
|
committing changelog
|
2018-02-06 02:23:25 +03:00
|
|
|
largefile: Outside/anotherlargefile, oid: 9703972eff7a4df07317eda436ab7ef827ed16ea28c62abdcd7de269745c610c
|
2017-08-11 03:54:18 +03:00
|
|
|
writing lfs metadata to sqlite
|
|
|
|
updating the branch cache
|
2018-04-24 02:09:13 +03:00
|
|
|
|
|
|
|
$ hg manifest -vr tip
|
|
|
|
644 Main/a
|
|
|
|
644 Main/largefile
|
|
|
|
644 Outside/anotherlargefile
|
|
|
|
644 Outside/b
|
2017-08-11 03:54:18 +03:00
|
|
|
|
|
|
|
Verify
|
|
|
|
(waiting for https://patchwork.mercurial-scm.org/patch/20582/)
|
|
|
|
|
2018-02-06 02:23:25 +03:00
|
|
|
$ cd $hgwd
|
2017-08-11 03:54:18 +03:00
|
|
|
$ hg --debug verify --config verify.skipflags=8192
|
|
|
|
repository uses revlog format 1
|
|
|
|
checking changesets
|
|
|
|
checking manifests
|
|
|
|
crosschecking files in changesets and manifests
|
|
|
|
checking files
|
2018-04-24 02:09:13 +03:00
|
|
|
4 files, 3 changesets, 6 total revisions
|
2017-08-11 03:54:18 +03:00
|
|
|
|
|
|
|
$ test -d .hg/store/lfs/objects
|
|
|
|
$ sqlite3 lfs.sql "SELECT * FROM p4_lfs_map"
|
|
|
|
1|1|*|37a7b43abd9e105a0e6b22088b140735a02f288767fe7a6f4f436cb46b064ca9|//depot/Main/largefile (glob)
|
|
|
|
2|2|*|b0d5c1968efbabbff9d94160f284cd7b52686ca3c46cfffdd351de07384fce9c|//depot/Main/largefile (glob)
|
2018-02-06 02:23:25 +03:00
|
|
|
3|3|*|9703972eff7a4df07317eda436ab7ef827ed16ea28c62abdcd7de269745c610c|//depot/Outside/anotherlargefile (glob)
|
2017-08-11 03:54:18 +03:00
|
|
|
|
|
|
|
End Test
|
|
|
|
|
|
|
|
stopping the p4 server
|