Patchwork [45,of,48,RFC] commitablefilectx: move __init__ from workingfilectx

login
register
mail settings
Submitter Sean Farley
Date Sept. 5, 2013, 8:07 p.m.
Message ID <abc3acd32a7860c73680.1378411659@laptop.local>
Download mbox | patch
Permalink /patch/2383/
State Accepted
Commit d25fdd4c2fd1362e8262f236b47fc81c194315d7
Headers show

Comments

Sean Farley - Sept. 5, 2013, 8:07 p.m.
# HG changeset patch
# User Sean Farley <sean.michael.farley@gmail.com>
# Date 1376590370 18000
#      Thu Aug 15 13:12:50 2013 -0500
# Node ID abc3acd32a7860c73680d15cecf525ec1cca0b8a
# Parent  4bee0401bfe496be4aea50a0ff61df1aff8f814a
commitablefilectx: move __init__ from workingfilectx

Patch

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -1190,25 +1190,25 @@ 
 
 class commitablefilectx(basefilectx):
     """A commitablefilectx provides common functionality for a file context that
     wants the ability to commit, e.g. workingfilectx or memfilectx."""
     def __init__(self, repo, path, filelog=None, ctx=None):
-        pass
-
-class workingfilectx(commitablefilectx):
-    """A workingfilectx object makes access to data related to a particular
-       file in the working directory convenient."""
-    def __init__(self, repo, path, filelog=None, workingctx=None):
         self._repo = repo
         self._path = path
         self._changeid = None
         self._filerev = self._filenode = None
 
         if filelog is not None:
             self._filelog = filelog
-        if workingctx:
-            self._changectx = workingctx
+        if ctx:
+            self._changectx = ctx
+
+class workingfilectx(commitablefilectx):
+    """A workingfilectx object makes access to data related to a particular
+       file in the working directory convenient."""
+    def __init__(self, repo, path, filelog=None, workingctx=None):
+        super(workingfilectx, self).__init__(repo, path, filelog, workingctx)
 
     @propertycache
     def _changectx(self):
         return workingctx(self._repo)