Patchwork [5,of,8] committablectx: move status to workingctx

login
register
mail settings
Submitter Sean Farley
Date May 6, 2014, 11:33 p.m.
Message ID <2bb99e94978f9da3a6eb.1399419202@laptop.local>
Download mbox | patch
Permalink /patch/4650/
State Accepted
Commit 3925d9460d274224fedc697c91d748be4813c6ab
Headers show

Comments

Sean Farley - May 6, 2014, 11:33 p.m.
# HG changeset patch
# User Sean Farley <sean.michael.farley@gmail.com>
# Date 1394580489 18000
#      Tue Mar 11 18:28:09 2014 -0500
# Node ID 2bb99e94978f9da3a6eb50bbddcbbfec28f399a1
# Parent  dae520d39627d8fd50668c590516baaae236d26b
committablectx: move status to workingctx

This method was accidentally placed into the committablectx class. It contains
logic for querying the dirstate so we move it to the correct class.
Pierre-Yves David - May 15, 2014, 1 a.m.
On 05/06/2014 04:33 PM, Sean Farley wrote:
> # HG changeset patch
> # User Sean Farley <sean.michael.farley@gmail.com>
> # Date 1394580489 18000
> #      Tue Mar 11 18:28:09 2014 -0500
> # Node ID 2bb99e94978f9da3a6eb50bbddcbbfec28f399a1
> # Parent  dae520d39627d8fd50668c590516baaae236d26b
> committablectx: move status to workingctx

patch 2-5 have been queued.

I pushed them to the clowncopter a few second ago.

I need to wrap my head around the next step.

Patch 1 have a dubious assumption about: "unknown == ~deleted" Sean is 
investigating it.

Patch

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -931,26 +931,10 @@  class committablectx(basectx):
 
     @propertycache
     def _date(self):
         return util.makedate()
 
-    def status(self, ignored=False, clean=False, unknown=False):
-        """Explicit status query
-        Unless this method is used to query the working copy status, the
-        _status property will implicitly read the status using its default
-        arguments."""
-        stat = self._repo.status(ignored=ignored, clean=clean, unknown=unknown)
-        self._unknown = self._ignored = self._clean = None
-        if unknown:
-            self._unknown = stat[4]
-        if ignored:
-            self._ignored = stat[5]
-        if clean:
-            self._clean = stat[6]
-        self._status = stat[:4]
-        return stat
-
     def user(self):
         return self._user or self._repo.ui.username()
     def date(self):
         return self._date
     def description(self):
@@ -1229,10 +1213,26 @@  class workingctx(committablectx):
                     wlock.release()
             except error.LockError:
                 pass
         return modified, fixup
 
+    def status(self, ignored=False, clean=False, unknown=False):
+        """Explicit status query
+        Unless this method is used to query the working copy status, the
+        _status property will implicitly read the status using its default
+        arguments."""
+        stat = self._repo.status(ignored=ignored, clean=clean, unknown=unknown)
+        self._unknown = self._ignored = self._clean = None
+        if unknown:
+            self._unknown = stat[4]
+        if ignored:
+            self._ignored = stat[5]
+        if clean:
+            self._clean = stat[6]
+        self._status = stat[:4]
+        return stat
+
 
 class committablefilectx(basefilectx):
     """A committablefilectx 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):