##// END OF EJS Templates
convert: use _ prefix for private methods in hg sink...
Martin von Zweigbergk -
r27717:5deff127 default
parent child Browse files
Show More
@@ -488,13 +488,13 b' class mercurial_source(converter_source)'
488 self.keep = nodes.__contains__
488 self.keep = nodes.__contains__
489 self._heads = nodes - parents
489 self._heads = nodes - parents
490
490
491 def changectx(self, rev):
491 def _changectx(self, rev):
492 if self.lastrev != rev:
492 if self.lastrev != rev:
493 self.lastctx = self.repo[rev]
493 self.lastctx = self.repo[rev]
494 self.lastrev = rev
494 self.lastrev = rev
495 return self.lastctx
495 return self.lastctx
496
496
497 def parents(self, ctx):
497 def _parents(self, ctx):
498 return [p for p in ctx.parents() if p and self.keep(p.node())]
498 return [p for p in ctx.parents() if p and self.keep(p.node())]
499
499
500 def getheads(self):
500 def getheads(self):
@@ -502,14 +502,14 b' class mercurial_source(converter_source)'
502
502
503 def getfile(self, name, rev):
503 def getfile(self, name, rev):
504 try:
504 try:
505 fctx = self.changectx(rev)[name]
505 fctx = self._changectx(rev)[name]
506 return fctx.data(), fctx.flags()
506 return fctx.data(), fctx.flags()
507 except error.LookupError:
507 except error.LookupError:
508 return None, None
508 return None, None
509
509
510 def getchanges(self, rev, full):
510 def getchanges(self, rev, full):
511 ctx = self.changectx(rev)
511 ctx = self._changectx(rev)
512 parents = self.parents(ctx)
512 parents = self._parents(ctx)
513 if full or not parents:
513 if full or not parents:
514 files = copyfiles = ctx.manifest()
514 files = copyfiles = ctx.manifest()
515 if parents:
515 if parents:
@@ -520,9 +520,9 b' class mercurial_source(converter_source)'
520 if not full:
520 if not full:
521 files = m + a + r
521 files = m + a + r
522 copyfiles = m + a
522 copyfiles = m + a
523 # getcopies() is also run for roots and before filtering so missing
523 # _getcopies() is also run for roots and before filtering so missing
524 # revlogs are detected early
524 # revlogs are detected early
525 copies = self.getcopies(ctx, parents, copyfiles)
525 copies = self._getcopies(ctx, parents, copyfiles)
526 cleanp2 = set()
526 cleanp2 = set()
527 if len(parents) == 2:
527 if len(parents) == 2:
528 cleanp2.update(self.repo.status(parents[1].node(), ctx.node(),
528 cleanp2.update(self.repo.status(parents[1].node(), ctx.node(),
@@ -531,7 +531,7 b' class mercurial_source(converter_source)'
531 changes.sort()
531 changes.sort()
532 return changes, copies, cleanp2
532 return changes, copies, cleanp2
533
533
534 def getcopies(self, ctx, parents, files):
534 def _getcopies(self, ctx, parents, files):
535 copies = {}
535 copies = {}
536 for name in files:
536 for name in files:
537 if name in self.ignored:
537 if name in self.ignored:
@@ -559,8 +559,8 b' class mercurial_source(converter_source)'
559 return copies
559 return copies
560
560
561 def getcommit(self, rev):
561 def getcommit(self, rev):
562 ctx = self.changectx(rev)
562 ctx = self._changectx(rev)
563 parents = [p.hex() for p in self.parents(ctx)]
563 parents = [p.hex() for p in self._parents(ctx)]
564 crev = rev
564 crev = rev
565
565
566 return commit(author=ctx.user(),
566 return commit(author=ctx.user(),
@@ -578,8 +578,8 b' class mercurial_source(converter_source)'
578 if self.keep(node)])
578 if self.keep(node)])
579
579
580 def getchangedfiles(self, rev, i):
580 def getchangedfiles(self, rev, i):
581 ctx = self.changectx(rev)
581 ctx = self._changectx(rev)
582 parents = self.parents(ctx)
582 parents = self._parents(ctx)
583 if not parents and i is None:
583 if not parents and i is None:
584 i = 0
584 i = 0
585 changes = [], ctx.manifest().keys(), []
585 changes = [], ctx.manifest().keys(), []
General Comments 0
You need to be logged in to leave comments. Login now