##// END OF EJS Templates
remove appendfile for the manifest when adding a changegroup...
Benoit Boissinot -
r2395:8ed45fb1 default
parent child Browse files
Show More
@@ -1498,8 +1498,8 b' class localrepository(object):'
1498
1498
1499 tr = self.transaction()
1499 tr = self.transaction()
1500
1500
1501 # write changelog and manifest data to temp files so
1501 # write changelog data to temp files so concurrent readers will not see
1502 # concurrent readers will not see inconsistent view
1502 # inconsistent view
1503 cl = None
1503 cl = None
1504 try:
1504 try:
1505 cl = appendfile.appendchangelog(self.opener, self.changelog.version)
1505 cl = appendfile.appendchangelog(self.opener, self.changelog.version)
@@ -1515,51 +1515,38 b' class localrepository(object):'
1515 cnr = cl.count() - 1
1515 cnr = cl.count() - 1
1516 changesets = cnr - cor
1516 changesets = cnr - cor
1517
1517
1518 mf = None
1518 # pull off the manifest group
1519 try:
1519 self.ui.status(_("adding manifests\n"))
1520 mf = appendfile.appendmanifest(self.opener,
1520 chunkiter = changegroup.chunkiter(source)
1521 self.manifest.version)
1521 # no need to check for empty manifest group here:
1522
1522 # if the result of the merge of 1 and 2 is the same in 3 and 4,
1523 # pull off the manifest group
1523 # no new manifest will be created and the manifest group will
1524 self.ui.status(_("adding manifests\n"))
1524 # be empty during the pull
1525 chunkiter = changegroup.chunkiter(source)
1525 self.manifest.addgroup(chunkiter, revmap, tr)
1526 # no need to check for empty manifest group here:
1527 # if the result of the merge of 1 and 2 is the same in 3 and 4,
1528 # no new manifest will be created and the manifest group will
1529 # be empty during the pull
1530 mf.addgroup(chunkiter, revmap, tr)
1531
1526
1532 # process the files
1527 # process the files
1533 self.ui.status(_("adding file changes\n"))
1528 self.ui.status(_("adding file changes\n"))
1534 while 1:
1529 while 1:
1535 f = changegroup.getchunk(source)
1530 f = changegroup.getchunk(source)
1536 if not f:
1531 if not f:
1537 break
1532 break
1538 self.ui.debug(_("adding %s revisions\n") % f)
1533 self.ui.debug(_("adding %s revisions\n") % f)
1539 fl = self.file(f)
1534 fl = self.file(f)
1540 o = fl.count()
1535 o = fl.count()
1541 chunkiter = changegroup.chunkiter(source)
1536 chunkiter = changegroup.chunkiter(source)
1542 if fl.addgroup(chunkiter, revmap, tr) is None:
1537 if fl.addgroup(chunkiter, revmap, tr) is None:
1543 raise util.Abort(_("received file revlog group is empty"))
1538 raise util.Abort(_("received file revlog group is empty"))
1544 revisions += fl.count() - o
1539 revisions += fl.count() - o
1545 files += 1
1540 files += 1
1546
1541
1547 # write order here is important so concurrent readers will see
1548 # consistent view of repo
1549 mf.writedata()
1550 finally:
1551 if mf:
1552 mf.cleanup()
1553 cl.writedata()
1542 cl.writedata()
1554 finally:
1543 finally:
1555 if cl:
1544 if cl:
1556 cl.cleanup()
1545 cl.cleanup()
1557
1546
1558 # make changelog and manifest see real files again
1547 # make changelog see real files again
1559 self.changelog = changelog.changelog(self.opener, self.changelog.version)
1548 self.changelog = changelog.changelog(self.opener, self.changelog.version)
1560 self.manifest = manifest.manifest(self.opener, self.manifest.version)
1561 self.changelog.checkinlinesize(tr)
1549 self.changelog.checkinlinesize(tr)
1562 self.manifest.checkinlinesize(tr)
1563
1550
1564 newheads = len(self.changelog.heads())
1551 newheads = len(self.changelog.heads())
1565 heads = ""
1552 heads = ""
General Comments 0
You need to be logged in to leave comments. Login now