##// END OF EJS Templates
manifest: remove _repo from manifestctx objects...
Durham Goode -
r31153:5cab44fd default
parent child Browse files
Show More
@@ -1261,8 +1261,6 b' class manifestlog(object):'
1261 class do not care about the implementation details of the actual manifests
1261 class do not care about the implementation details of the actual manifests
1262 they receive (i.e. tree or flat or lazily loaded, etc)."""
1262 they receive (i.e. tree or flat or lazily loaded, etc)."""
1263 def __init__(self, opener, repo):
1263 def __init__(self, opener, repo):
1264 self._repo = repo
1265
1266 usetreemanifest = False
1264 usetreemanifest = False
1267 cachesize = 4
1265 cachesize = 4
1268
1266
@@ -1309,7 +1307,7 b' class manifestlog(object):'
1309 if node not in dirlog.nodemap:
1307 if node not in dirlog.nodemap:
1310 raise LookupError(node, dirlog.indexfile,
1308 raise LookupError(node, dirlog.indexfile,
1311 _('no node'))
1309 _('no node'))
1312 m = treemanifestctx(self._repo, dir, node)
1310 m = treemanifestctx(self, dir, node)
1313 else:
1311 else:
1314 raise error.Abort(
1312 raise error.Abort(
1315 _("cannot ask for manifest directory '%s' in a flat "
1313 _("cannot ask for manifest directory '%s' in a flat "
@@ -1320,9 +1318,9 b' class manifestlog(object):'
1320 raise LookupError(node, self._revlog.indexfile,
1318 raise LookupError(node, self._revlog.indexfile,
1321 _('no node'))
1319 _('no node'))
1322 if self._treeinmem:
1320 if self._treeinmem:
1323 m = treemanifestctx(self._repo, '', node)
1321 m = treemanifestctx(self, '', node)
1324 else:
1322 else:
1325 m = manifestctx(self._repo, node)
1323 m = manifestctx(self, node)
1326
1324
1327 if node != revlog.nullid:
1325 if node != revlog.nullid:
1328 mancache = self._dirmancache.get(dir)
1326 mancache = self._dirmancache.get(dir)
@@ -1337,18 +1335,18 b' class manifestlog(object):'
1337 self._revlog.clearcaches()
1335 self._revlog.clearcaches()
1338
1336
1339 class memmanifestctx(object):
1337 class memmanifestctx(object):
1340 def __init__(self, repo):
1338 def __init__(self, manifestlog):
1341 self._repo = repo
1339 self._manifestlog = manifestlog
1342 self._manifestdict = manifestdict()
1340 self._manifestdict = manifestdict()
1343
1341
1344 def _revlog(self):
1342 def _revlog(self):
1345 return self._repo.manifestlog._revlog
1343 return self._manifestlog._revlog
1346
1344
1347 def new(self):
1345 def new(self):
1348 return memmanifestctx(self._repo)
1346 return memmanifestctx(self._manifestlog)
1349
1347
1350 def copy(self):
1348 def copy(self):
1351 memmf = memmanifestctx(self._repo)
1349 memmf = memmanifestctx(self._manifestlog)
1352 memmf._manifestdict = self.read().copy()
1350 memmf._manifestdict = self.read().copy()
1353 return memmf
1351 return memmf
1354
1352
@@ -1363,8 +1361,8 b' class manifestctx(object):'
1363 """A class representing a single revision of a manifest, including its
1361 """A class representing a single revision of a manifest, including its
1364 contents, its parent revs, and its linkrev.
1362 contents, its parent revs, and its linkrev.
1365 """
1363 """
1366 def __init__(self, repo, node):
1364 def __init__(self, manifestlog, node):
1367 self._repo = repo
1365 self._manifestlog = manifestlog
1368 self._data = None
1366 self._data = None
1369
1367
1370 self._node = node
1368 self._node = node
@@ -1377,16 +1375,16 b' class manifestctx(object):'
1377 #self.linkrev = revlog.linkrev(rev)
1375 #self.linkrev = revlog.linkrev(rev)
1378
1376
1379 def _revlog(self):
1377 def _revlog(self):
1380 return self._repo.manifestlog._revlog
1378 return self._manifestlog._revlog
1381
1379
1382 def node(self):
1380 def node(self):
1383 return self._node
1381 return self._node
1384
1382
1385 def new(self):
1383 def new(self):
1386 return memmanifestctx(self._repo)
1384 return memmanifestctx(self._manifestlog)
1387
1385
1388 def copy(self):
1386 def copy(self):
1389 memmf = memmanifestctx(self._repo)
1387 memmf = memmanifestctx(self._manifestlog)
1390 memmf._manifestdict = self.read().copy()
1388 memmf._manifestdict = self.read().copy()
1391 return memmf
1389 return memmf
1392
1390
@@ -1431,7 +1429,7 b' class manifestctx(object):'
1431 if revlog._usemanifestv2:
1429 if revlog._usemanifestv2:
1432 # Need to perform a slow delta
1430 # Need to perform a slow delta
1433 r0 = revlog.deltaparent(revlog.rev(self._node))
1431 r0 = revlog.deltaparent(revlog.rev(self._node))
1434 m0 = self._repo.manifestlog[revlog.node(r0)].read()
1432 m0 = self._manifestlog[revlog.node(r0)].read()
1435 m1 = self.read()
1433 m1 = self.read()
1436 md = manifestdict()
1434 md = manifestdict()
1437 for f, ((n0, fl0), (n1, fl1)) in m0.diff(m1).iteritems():
1435 for f, ((n0, fl0), (n1, fl1)) in m0.diff(m1).iteritems():
@@ -1449,19 +1447,19 b' class manifestctx(object):'
1449 return self.read().find(key)
1447 return self.read().find(key)
1450
1448
1451 class memtreemanifestctx(object):
1449 class memtreemanifestctx(object):
1452 def __init__(self, repo, dir=''):
1450 def __init__(self, manifestlog, dir=''):
1453 self._repo = repo
1451 self._manifestlog = manifestlog
1454 self._dir = dir
1452 self._dir = dir
1455 self._treemanifest = treemanifest()
1453 self._treemanifest = treemanifest()
1456
1454
1457 def _revlog(self):
1455 def _revlog(self):
1458 return self._repo.manifestlog._revlog
1456 return self._manifestlog._revlog
1459
1457
1460 def new(self, dir=''):
1458 def new(self, dir=''):
1461 return memtreemanifestctx(self._repo, dir=dir)
1459 return memtreemanifestctx(self._manifestlog, dir=dir)
1462
1460
1463 def copy(self):
1461 def copy(self):
1464 memmf = memtreemanifestctx(self._repo, dir=self._dir)
1462 memmf = memtreemanifestctx(self._manifestlog, dir=self._dir)
1465 memmf._treemanifest = self._treemanifest.copy()
1463 memmf._treemanifest = self._treemanifest.copy()
1466 return memmf
1464 return memmf
1467
1465
@@ -1470,13 +1468,13 b' class memtreemanifestctx(object):'
1470
1468
1471 def write(self, transaction, link, p1, p2, added, removed):
1469 def write(self, transaction, link, p1, p2, added, removed):
1472 def readtree(dir, node):
1470 def readtree(dir, node):
1473 return self._repo.manifestlog.get(dir, node).read()
1471 return self._manifestlog.get(dir, node).read()
1474 return self._revlog().add(self._treemanifest, transaction, link, p1, p2,
1472 return self._revlog().add(self._treemanifest, transaction, link, p1, p2,
1475 added, removed, readtree=readtree)
1473 added, removed, readtree=readtree)
1476
1474
1477 class treemanifestctx(object):
1475 class treemanifestctx(object):
1478 def __init__(self, repo, dir, node):
1476 def __init__(self, manifestlog, dir, node):
1479 self._repo = repo
1477 self._manifestlog = manifestlog
1480 self._dir = dir
1478 self._dir = dir
1481 self._data = None
1479 self._data = None
1482
1480
@@ -1490,7 +1488,7 b' class treemanifestctx(object):'
1490 #self.linkrev = revlog.linkrev(rev)
1488 #self.linkrev = revlog.linkrev(rev)
1491
1489
1492 def _revlog(self):
1490 def _revlog(self):
1493 return self._repo.manifestlog._revlog.dirlog(self._dir)
1491 return self._manifestlog._revlog.dirlog(self._dir)
1494
1492
1495 def read(self):
1493 def read(self):
1496 if self._data is None:
1494 if self._data is None:
@@ -1504,8 +1502,7 b' class treemanifestctx(object):'
1504 def readsubtree(dir, subm):
1502 def readsubtree(dir, subm):
1505 # Set verify to False since we need to be able to create
1503 # Set verify to False since we need to be able to create
1506 # subtrees for trees that don't exist on disk.
1504 # subtrees for trees that don't exist on disk.
1507 return self._repo.manifestlog.get(dir, subm,
1505 return self._manifestlog.get(dir, subm, verify=False).read()
1508 verify=False).read()
1509 m.read(gettext, readsubtree)
1506 m.read(gettext, readsubtree)
1510 m.setnode(self._node)
1507 m.setnode(self._node)
1511 self._data = m
1508 self._data = m
@@ -1521,10 +1518,10 b' class treemanifestctx(object):'
1521 return self._node
1518 return self._node
1522
1519
1523 def new(self, dir=''):
1520 def new(self, dir=''):
1524 return memtreemanifestctx(self._repo, dir=dir)
1521 return memtreemanifestctx(self._manifestlog, dir=dir)
1525
1522
1526 def copy(self):
1523 def copy(self):
1527 memmf = memtreemanifestctx(self._repo, dir=self._dir)
1524 memmf = memtreemanifestctx(self._manifestlog, dir=self._dir)
1528 memmf._treemanifest = self.read().copy()
1525 memmf._treemanifest = self.read().copy()
1529 return memmf
1526 return memmf
1530
1527
@@ -1551,7 +1548,7 b' class treemanifestctx(object):'
1551 else:
1548 else:
1552 # Need to perform a slow delta
1549 # Need to perform a slow delta
1553 r0 = revlog.deltaparent(revlog.rev(self._node))
1550 r0 = revlog.deltaparent(revlog.rev(self._node))
1554 m0 = self._repo.manifestlog.get(self._dir, revlog.node(r0)).read()
1551 m0 = self._manifestlog.get(self._dir, revlog.node(r0)).read()
1555 m1 = self.read()
1552 m1 = self.read()
1556 md = treemanifest(dir=self._dir)
1553 md = treemanifest(dir=self._dir)
1557 for f, ((n0, fl0), (n1, fl1)) in m0.diff(m1).iteritems():
1554 for f, ((n0, fl0), (n1, fl1)) in m0.diff(m1).iteritems():
General Comments 0
You need to be logged in to leave comments. Login now