Mercurial > kallithea
diff rhodecode/lib/unionrepo.py @ 3578:f3283898d431 beta
pep8 unionrepo
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Sun, 24 Mar 2013 19:53:09 +0100 |
parents | 6354556781ef |
children |
line wrap: on
line diff
--- a/rhodecode/lib/unionrepo.py Sun Mar 24 03:07:04 2013 +0100 +++ b/rhodecode/lib/unionrepo.py Sun Mar 24 19:53:09 2013 +0100 @@ -17,6 +17,7 @@ from mercurial import util, mdiff, cmdutil, scmutil from mercurial import localrepo, changelog, manifest, filelog, revlog + class unionrevlog(revlog.revlog): def __init__(self, opener, indexfile, revlog2, linkmapper): # How it works: @@ -31,16 +32,16 @@ n = len(self) self.repotiprev = n - 1 - self.bundlerevs = set() # used by 'bundle()' revset expression + self.bundlerevs = set() # used by 'bundle()' revset expression for rev2 in self.revlog2: rev = self.revlog2.index[rev2] # rev numbers - in revlog2, very different from self.rev _start, _csize, _rsize, _base, linkrev, p1rev, p2rev, node = rev - if linkmapper is None: # link is to same revlog - assert linkrev == rev2 # we never link back + if linkmapper is None: # link is to same revlog + assert linkrev == rev2 # we never link back link = n - else: # rev must be mapped from repo2 cl to unified cl by linkmapper + else: # rev must be mapped from repo2 cl to unified cl by linkmapper link = linkmapper(linkrev) if node in self.nodemap: @@ -99,13 +100,17 @@ def addrevision(self, text, transaction, link, p1=None, p2=None, d=None): raise NotImplementedError + def addgroup(self, revs, linkmapper, transaction): raise NotImplementedError + def strip(self, rev, minlink): raise NotImplementedError + def checksize(self): raise NotImplementedError + class unionchangelog(unionrevlog, changelog.changelog): def __init__(self, opener, opener2): changelog.changelog.__init__(self, opener) @@ -114,6 +119,7 @@ unionrevlog.__init__(self, opener, self.indexfile, changelog2, linkmapper) + class unionmanifest(unionrevlog, manifest.manifest): def __init__(self, opener, opener2, linkmapper): manifest.manifest.__init__(self, opener) @@ -121,6 +127,7 @@ unionrevlog.__init__(self, opener, self.indexfile, manifest2, linkmapper) + class unionfilelog(unionrevlog, filelog.filelog): def __init__(self, opener, path, opener2, linkmapper, repo): filelog.filelog.__init__(self, opener, path) @@ -132,10 +139,12 @@ def _file(self, f): self._repo.file(f) + class unionpeer(localrepo.localpeer): def canpush(self): return False + class unionrepository(localrepo.localrepository): def __init__(self, ui, path, path2): localrepo.localrepository.__init__(self, ui, path) @@ -176,7 +185,8 @@ return unionpeer(self) def getcwd(self): - return os.getcwd() # always outside the repo + return os.getcwd() # always outside the repo + def instance(ui, path, create): if create: @@ -194,7 +204,7 @@ if parentpath == cwd: parentpath = '' else: - cwd = os.path.join(cwd,'') + cwd = os.path.join(cwd, '') if parentpath.startswith(cwd): parentpath = parentpath[len(cwd):] if path.startswith('union:'):