mirror of
https://github.com/facebook/sapling.git
synced 2024-10-09 16:31:02 +03:00
a3df4258d7
Summary: p4seqimport will be the new command to import from p4 to hg changelist by changelist. This should provide us with a more robust importer that doesn't rely on fiddling with hg's data structures directly. p4fastimport was important to create ovrsource from scratch and import thousands of changelists, but moving forward it is probably safer and easier to understand/maintain something that is based on higher level Mercurial APIs All that said, this is the first change, this change: 1. Creates p4seqimport command as part of the p4fastimport extension 2. Refactors the p4 client checking logic into `enforce_p4_client_exists` 3. Adds a test that checks the new function works through using `p4seqimport`. For a high-level overview of p4seqimport, please check https://our.intern.facebook.com/intern/wiki/IDI/p4seqimport/ Differential Revision: D7015941 fbshipit-source-id: cb5c59b2f104f336a078025544a44028bf01fa85
52 lines
1.2 KiB
Perl
52 lines
1.2 KiB
Perl
#require p4
|
|
|
|
$ . $TESTDIR/p4setup.sh
|
|
|
|
populate the depot
|
|
$ mkdir Main
|
|
$ mkdir Main/b
|
|
$ echo a > Main/a
|
|
$ echo c > Main/b/c
|
|
$ echo d > Main/d
|
|
$ p4 add Main/a Main/b/c Main/d
|
|
//depot/Main/a#1 - opened for add
|
|
//depot/Main/b/c#1 - opened for add
|
|
//depot/Main/d#1 - opened for add
|
|
$ p4 submit -d initial
|
|
Submitting change 1.
|
|
Locking 3 files ...
|
|
add //depot/Main/a#1
|
|
add //depot/Main/b/c#1
|
|
add //depot/Main/d#1
|
|
Change 1 submitted.
|
|
|
|
$ p4 edit Main/a Main/b/c Main/d
|
|
//depot/Main/a#1 - opened for edit
|
|
//depot/Main/b/c#1 - opened for edit
|
|
//depot/Main/d#1 - opened for edit
|
|
$ echo a >> Main/a
|
|
$ echo c >> Main/b/c
|
|
$ echo d >> Main/d
|
|
$ p4 submit -d second
|
|
Submitting change 2.
|
|
Locking 3 files ...
|
|
edit //depot/Main/a#2
|
|
edit //depot/Main/b/c#2
|
|
edit //depot/Main/d#2
|
|
Change 2 submitted.
|
|
|
|
Simple import
|
|
|
|
$ cd $hgwd
|
|
$ hg init --config 'format.usefncache=False'
|
|
$ hg p4fastimport --bookmark master --debug -P $P4ROOT foo-does-not-exist
|
|
abort: p4 client foo-does-not-exist does not exist.
|
|
[255]
|
|
$ hg p4seqimport --debug -B master -P $P4ROOT bar-does-not-exist
|
|
abort: p4 client bar-does-not-exist does not exist.
|
|
[255]
|
|
|
|
End Test
|
|
|
|
stopping the p4 server
|