comparison tests/test-convert-p4.t @ 30632:1d0e4832e616

convert: parse perforce data on-demand We are using read-only attributes that parse the perforce data on demand. We are reading the data only once whenever an attribute is requested and use it throughout the import process. This is equivalent to the previous behavior, but we are avoiding reading from perforce when we initialize the object, but instead run it during the actual import process, when the first attribute is requested (usually getheads(), see `convertcmd.convert`).
author David Soria Parra <davidsp@fb.com>
date Tue, 20 Dec 2016 09:23:50 -0800
parents a970a5c15b43
children 78ac8acfc4bd
comparison
equal deleted inserted replaced
30631:c2be48e56d59 30632:1d0e4832e616
65 Change 3 submitted. 65 Change 3 submitted.
66 66
67 convert 67 convert
68 $ hg convert -s p4 $DEPOTPATH dst 68 $ hg convert -s p4 $DEPOTPATH dst
69 initializing destination dst repository 69 initializing destination dst repository
70 scanning source...
70 reading p4 views 71 reading p4 views
71 collecting p4 changelists 72 collecting p4 changelists
72 1 initial 73 1 initial
73 2 change a 74 2 change a
74 3 change b/c 75 3 change b/c
75 scanning source...
76 sorting... 76 sorting...
77 converting... 77 converting...
78 2 initial 78 2 initial
79 1 change a 79 1 change a
80 0 change b/c 80 0 change b/c
96 edit //depot/test-mercurial-import/b/c#3 96 edit //depot/test-mercurial-import/b/c#3
97 Change 4 submitted. 97 Change 4 submitted.
98 98
99 convert again 99 convert again
100 $ hg convert -s p4 $DEPOTPATH dst 100 $ hg convert -s p4 $DEPOTPATH dst
101 scanning source...
101 reading p4 views 102 reading p4 views
102 collecting p4 changelists 103 collecting p4 changelists
103 1 initial
104 2 change a
105 3 change b/c
106 4 change a b/c 104 4 change a b/c
107 scanning source...
108 sorting... 105 sorting...
109 converting... 106 converting...
110 0 change a b/c 107 0 change a b/c
111 $ hg -R dst log --template 'rev={rev} desc="{desc}" tags="{tags}" files="{files}"\n' 108 $ hg -R dst log --template 'rev={rev} desc="{desc}" tags="{tags}" files="{files}"\n'
112 rev=3 desc="change a b/c" tags="tip" files="a b/c" 109 rev=3 desc="change a b/c" tags="tip" files="a b/c"
128 add //depot/test-mercurial-import/d d#1 125 add //depot/test-mercurial-import/d d#1
129 Change 5 submitted. 126 Change 5 submitted.
130 127
131 convert again 128 convert again
132 $ hg convert -s p4 $DEPOTPATH dst 129 $ hg convert -s p4 $DEPOTPATH dst
130 scanning source...
133 reading p4 views 131 reading p4 views
134 collecting p4 changelists 132 collecting p4 changelists
135 1 initial
136 2 change a
137 3 change b/c
138 4 change a b/c
139 5 add d e f 133 5 add d e f
140 scanning source...
141 sorting... 134 sorting...
142 converting... 135 converting...
143 0 add d e f 136 0 add d e f
144 $ hg -R dst log --template 'rev={rev} desc="{desc}" tags="{tags}" files="{files}"\n' 137 $ hg -R dst log --template 'rev={rev} desc="{desc}" tags="{tags}" files="{files}"\n'
145 rev=4 desc="add d e f" tags="tip" files=" e/ f d d" 138 rev=4 desc="add d e f" tags="tip" files=" e/ f d d"