Patchwork [24,of,48,RFC] commitablectx: move added from workingctx

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

Comments

Sean Farley - Sept. 5, 2013, 8:07 p.m.
# HG changeset patch
# User Sean Farley <sean.michael.farley@gmail.com>
# Date 1376514918 18000
#      Wed Aug 14 16:15:18 2013 -0500
# Node ID 099d75b3133bf6109c1ab426075d9b30957082c7
# Parent  03874cca7c1612cfd557d218dfc0bcd0c64ff1e2
commitablectx: move added from workingctx

Patch

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -970,10 +970,12 @@ 
     def files(self):
         return sorted(self._status[0] + self._status[1] + self._status[2])
 
     def modified(self):
         return self._status[0]
+    def added(self):
+        return self._status[1]
 
 class workingctx(commitablectx):
     """A workingctx object makes access to data related to
     the current working directory convenient.
     date - any valid date string or (unixtime, offset), or None.
@@ -997,12 +999,10 @@ 
         p = self._repo.dirstate.parents()
         if p[1] == nullid:
             p = p[:-1]
         return [changectx(self._repo, x) for x in p]
 
-    def added(self):
-        return self._status[1]
     def removed(self):
         return self._status[2]
     def deleted(self):
         return self._status[3]
     def unknown(self):