Commit 5de500b
mononoke: passing LiveCommitSyncConfig all the way to CommitSyncer
Summary:
CommitSyncer is a struct that we use to remap a commit from one repo to another. It uses commit sync map to figure out which paths need to be changed. Commit sync mapping might change, and each commit sync mapping has a version associated with it.
At the moment CommitSyncer doesn't work correctly if a commit sync mapping is changed. Consider the following DAG
```
large repo
A' <- remapped with mapping V1
|
O B' <- remapped with mapping V1
| /
...
small repo
A
|
O B
| /
...
```
We have commit A and B from a small repo remapped into a large repo into commits A' and B'. They were remapped with commit sync mapping V1, which for example remaps files in "dir/" into "smallrepo/dir".
Now let's say we start to use a new mapping v2 which remaps "dir/" into "otherdir/". After this point every commit will be created with new mapping. But this is incorrect - if we create a commit on top of B in a small repo that touches "dir/file.txt" then it will be remapped into "otherdir/file.txt" in the large repo, even though every other file is still in "smallrepo/dir"!
The fix for this issue is to always use the same mapping as commit parent was using (there are a few tricky cases with merge commits and commits with no parents, but those will be dealt with separately).
This diff is the first step - it threads through LiveCommitSyncConfig all the way to the CommitSyncer object, so that CommitSyncer can always fetch whatever mapping it needs.
Reviewed By: ikostia
Differential Revision: D23845720
fbshipit-source-id: 555cc31fd4ce09f0a6fa2869bfcee2c7cdfbcc611 parent 0754074 commit 5de500b
File tree
24 files changed
+161
-56
lines changed- eden/mononoke
- cmds/admin
- commit_rewriting
- backsyncer/src
- bookmarks_validator/src
- commit_validator/src
- cross_repo_sync
- src
- test_utils
- test
- megarepo/tool
- mononoke_x_repo_sync_job/src
- mononoke_api/src
- repo_client/unbundle/src
- repo_import
- src
- tests/integration
24 files changed
+161
-56
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| |||
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
54 | 59 | | |
55 | 60 | | |
56 | 61 | | |
| |||
74 | 79 | | |
75 | 80 | | |
76 | 81 | | |
77 | | - | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
78 | 87 | | |
79 | 88 | | |
80 | 89 | | |
| |||
106 | 115 | | |
107 | 116 | | |
108 | 117 | | |
| 118 | + | |
109 | 119 | | |
110 | 120 | | |
111 | 121 | | |
112 | 122 | | |
113 | | - | |
| 123 | + | |
114 | 124 | | |
115 | 125 | | |
116 | 126 | | |
| |||
119 | 129 | | |
120 | 130 | | |
121 | 131 | | |
122 | | - | |
123 | 132 | | |
124 | 133 | | |
| 134 | + | |
125 | 135 | | |
126 | 136 | | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | 137 | | |
131 | 138 | | |
132 | 139 | | |
| |||
312 | 319 | | |
313 | 320 | | |
314 | 321 | | |
| 322 | + | |
315 | 323 | | |
316 | 324 | | |
317 | 325 | | |
318 | 326 | | |
319 | 327 | | |
320 | 328 | | |
321 | | - | |
| 329 | + | |
| 330 | + | |
322 | 331 | | |
323 | 332 | | |
324 | 333 | | |
| |||
609 | 618 | | |
610 | 619 | | |
611 | 620 | | |
| 621 | + | |
612 | 622 | | |
613 | 623 | | |
614 | 624 | | |
| |||
814 | 824 | | |
815 | 825 | | |
816 | 826 | | |
817 | | - | |
| 827 | + | |
| 828 | + | |
818 | 829 | | |
819 | 830 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
| |||
113 | 114 | | |
114 | 115 | | |
115 | 116 | | |
| 117 | + | |
116 | 118 | | |
117 | 119 | | |
118 | 120 | | |
| |||
131 | 133 | | |
132 | 134 | | |
133 | 135 | | |
134 | | - | |
| 136 | + | |
135 | 137 | | |
136 | 138 | | |
137 | 139 | | |
| |||
289 | 291 | | |
290 | 292 | | |
291 | 293 | | |
292 | | - | |
| 294 | + | |
| 295 | + | |
293 | 296 | | |
294 | 297 | | |
295 | 298 | | |
| |||
355 | 358 | | |
356 | 359 | | |
357 | 360 | | |
358 | | - | |
| 361 | + | |
| 362 | + | |
359 | 363 | | |
360 | 364 | | |
361 | 365 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| |||
904 | 905 | | |
905 | 906 | | |
906 | 907 | | |
| 908 | + | |
907 | 909 | | |
908 | | - | |
| 910 | + | |
909 | 911 | | |
910 | 912 | | |
911 | 913 | | |
| |||
1197 | 1199 | | |
1198 | 1200 | | |
1199 | 1201 | | |
1200 | | - | |
| 1202 | + | |
| 1203 | + | |
1201 | 1204 | | |
1202 | 1205 | | |
1203 | 1206 | | |
| |||
1433 | 1436 | | |
1434 | 1437 | | |
1435 | 1438 | | |
1436 | | - | |
| 1439 | + | |
| 1440 | + | |
1437 | 1441 | | |
1438 | 1442 | | |
1439 | 1443 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
109 | | - | |
| 109 | + | |
110 | 110 | | |
111 | 111 | | |
112 | | - | |
| 112 | + | |
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
662 | 662 | | |
663 | 663 | | |
664 | 664 | | |
| 665 | + | |
665 | 666 | | |
666 | 667 | | |
667 | 668 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
Lines changed: 9 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| 14 | + | |
13 | 15 | | |
14 | 16 | | |
15 | 17 | | |
| |||
50 | 52 | | |
51 | 53 | | |
52 | 54 | | |
| 55 | + | |
| 56 | + | |
53 | 57 | | |
54 | 58 | | |
55 | 59 | | |
| |||
58 | 62 | | |
59 | 63 | | |
60 | 64 | | |
61 | | - | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
62 | 70 | | |
63 | 71 | | |
64 | 72 | | |
| |||
Lines changed: 17 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| |||
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| 46 | + | |
45 | 47 | | |
46 | 48 | | |
47 | 49 | | |
| |||
485 | 487 | | |
486 | 488 | | |
487 | 489 | | |
| 490 | + | |
488 | 491 | | |
489 | 492 | | |
490 | 493 | | |
| |||
502 | 505 | | |
503 | 506 | | |
504 | 507 | | |
505 | | - | |
506 | | - | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
507 | 518 | | |
508 | 519 | | |
509 | 520 | | |
| |||
1253 | 1264 | | |
1254 | 1265 | | |
1255 | 1266 | | |
1256 | | - | |
| 1267 | + | |
1257 | 1268 | | |
1258 | 1269 | | |
1259 | 1270 | | |
| |||
1488 | 1499 | | |
1489 | 1500 | | |
1490 | 1501 | | |
| 1502 | + | |
1491 | 1503 | | |
1492 | 1504 | | |
1493 | 1505 | | |
| |||
1523 | 1535 | | |
1524 | 1536 | | |
1525 | 1537 | | |
| 1538 | + | |
1526 | 1539 | | |
1527 | 1540 | | |
1528 | 1541 | | |
1529 | 1542 | | |
| 1543 | + | |
1530 | 1544 | | |
1531 | 1545 | | |
1532 | 1546 | | |
| |||
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
654 | 654 | | |
655 | 655 | | |
656 | 656 | | |
| 657 | + | |
657 | 658 | | |
658 | 659 | | |
659 | 660 | | |
| |||
863 | 864 | | |
864 | 865 | | |
865 | 866 | | |
866 | | - | |
| 867 | + | |
| 868 | + | |
867 | 869 | | |
868 | 870 | | |
Lines changed: 6 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | 14 | | |
16 | 15 | | |
17 | 16 | | |
| |||
28 | 27 | | |
29 | 28 | | |
30 | 29 | | |
| 30 | + | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| |||
239 | 240 | | |
240 | 241 | | |
241 | 242 | | |
242 | | - | |
| 243 | + | |
| 244 | + | |
243 | 245 | | |
244 | 246 | | |
245 | 247 | | |
| |||
253 | 255 | | |
254 | 256 | | |
255 | 257 | | |
256 | | - | |
| 258 | + | |
| 259 | + | |
257 | 260 | | |
258 | 261 | | |
259 | 262 | | |
| |||
0 commit comments