Show More
@@ -11,7 +11,7 b' from node import *' | |||
|
11 | 11 | from i18n import gettext as _ |
|
12 | 12 | from demandload import * |
|
13 | 13 | demandload(globals(), "re lock transaction tempfile stat mdiff errno ui") |
|
14 | demandload(globals(), "changegroup") | |
|
14 | demandload(globals(), "appendfile changegroup") | |
|
15 | 15 | |
|
16 | 16 | class localrepository(object): |
|
17 | 17 | def __del__(self): |
@@ -1343,10 +1343,10 b' class localrepository(object):' | |||
|
1343 | 1343 | |
|
1344 | 1344 | def csmap(x): |
|
1345 | 1345 | self.ui.debug(_("add changeset %s\n") % short(x)) |
|
1346 |
return |
|
|
1346 | return cl.count() | |
|
1347 | 1347 | |
|
1348 | 1348 | def revmap(x): |
|
1349 |
return |
|
|
1349 | return cl.rev(x) | |
|
1350 | 1350 | |
|
1351 | 1351 | if not source: |
|
1352 | 1352 | return |
@@ -1357,23 +1357,29 b' class localrepository(object):' | |||
|
1357 | 1357 | |
|
1358 | 1358 | tr = self.transaction() |
|
1359 | 1359 | |
|
1360 | oldheads = len(self.changelog.heads()) | |
|
1360 | # write changelog and manifest data to temp files so | |
|
1361 | # concurrent readers will not see inconsistent view | |
|
1362 | cl = appendfile.appendchangelog(self.opener) | |
|
1363 | ||
|
1364 | oldheads = len(cl.heads()) | |
|
1361 | 1365 | |
|
1362 | 1366 | # pull off the changeset group |
|
1363 | 1367 | self.ui.status(_("adding changesets\n")) |
|
1364 |
co = |
|
|
1368 | co = cl.tip() | |
|
1365 | 1369 | chunkiter = changegroup.chunkiter(source) |
|
1366 |
cn = |
|
|
1367 |
cnr, cor = map( |
|
|
1370 | cn = cl.addgroup(chunkiter, csmap, tr, 1) # unique | |
|
1371 | cnr, cor = map(cl.rev, (cn, co)) | |
|
1368 | 1372 | if cn == nullid: |
|
1369 | 1373 | cnr = cor |
|
1370 | 1374 | changesets = cnr - cor |
|
1371 | 1375 | |
|
1376 | mf = appendfile.appendmanifest(self.opener) | |
|
1377 | ||
|
1372 | 1378 | # pull off the manifest group |
|
1373 | 1379 | self.ui.status(_("adding manifests\n")) |
|
1374 |
mm = |
|
|
1380 | mm = mf.tip() | |
|
1375 | 1381 | chunkiter = changegroup.chunkiter(source) |
|
1376 |
mo = |
|
|
1382 | mo = mf.addgroup(chunkiter, revmap, tr) | |
|
1377 | 1383 | |
|
1378 | 1384 | # process the files |
|
1379 | 1385 | self.ui.status(_("adding file changes\n")) |
@@ -1389,6 +1395,15 b' class localrepository(object):' | |||
|
1389 | 1395 | revisions += fl.count() - o |
|
1390 | 1396 | files += 1 |
|
1391 | 1397 | |
|
1398 | # write order here is important so concurrent readers will see | |
|
1399 | # consistent view of repo | |
|
1400 | mf.writedata() | |
|
1401 | cl.writedata() | |
|
1402 | ||
|
1403 | # make changelog and manifest see real files again | |
|
1404 | self.changelog = changelog.changelog(self.opener) | |
|
1405 | self.manifest = manifest.manifest(self.opener) | |
|
1406 | ||
|
1392 | 1407 | newheads = len(self.changelog.heads()) |
|
1393 | 1408 | heads = "" |
|
1394 | 1409 | if oldheads and newheads > oldheads: |
General Comments 0
You need to be logged in to leave comments.
Login now