Mercurial > public > mercurial-scm > hg-stable
diff contrib/synthrepo.py @ 21689:503bb3af70fe
memfilectx: call super.__init__ instead of duplicating code
This patch changes the calling signature of memfilectx's __init__ to fall in
line with the other file contexts.
Calling code and tests have been updated accordingly.
author | Sean Farley <sean.michael.farley@gmail.com> |
---|---|
date | Thu, 15 Aug 2013 16:49:27 -0500 |
parents | 05e58b08fdfe |
children | 054ec0212718 |
line wrap: on
line diff
--- a/contrib/synthrepo.py Thu Aug 15 15:23:36 2013 -0500 +++ b/contrib/synthrepo.py Thu Aug 15 16:49:27 2013 -0500 @@ -334,7 +334,7 @@ for __ in xrange(add): lines.insert(random.randint(0, len(lines)), makeline()) path = fctx.path() - changes[path] = context.memfilectx(path, + changes[path] = context.memfilectx(repo, path, '\n'.join(lines) + '\n') for __ in xrange(pick(filesremoved)): path = random.choice(mfk) @@ -354,7 +354,7 @@ path = '/'.join(filter(None, path)) data = '\n'.join(makeline() for __ in xrange(pick(linesinfilesadded))) + '\n' - changes[path] = context.memfilectx(path, data) + changes[path] = context.memfilectx(repo, path, data) def filectxfn(repo, memctx, path): data = changes[path] if data is None: