Patchwork [16,of,36] context: move __iter__ from changectx

login
register
mail settings
Submitter Sean Farley
Date Aug. 7, 2013, 6:13 p.m.
Message ID <48ba4ee3b3fb83edd87a.1375899196@laptop.local>
Download mbox | patch
Permalink /patch/2034/
State Superseded
Commit fbf7f2e4ea56fec5e6df25fa30d838f9a1a3c0a4
Delegated to: Augie Fackler
Headers show

Comments

Sean Farley - Aug. 7, 2013, 6:13 p.m.
# HG changeset patch
# User Sean Farley <sean.michael.farley@gmail.com>
# Date 1375741338 18000
#      Mon Aug 05 17:22:18 2013 -0500
# Node ID 48ba4ee3b3fb83edd87abbbcd7c1db403c04d0b5
# Parent  07f80f275f7130aa72b9ed8fa38cc2f6e2e0bbb9
context: move __iter__ from changectx

Patch

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -57,10 +57,14 @@ 
         return key in self._manifest
 
     def __getitem__(self, key):
         return self.filectx(key)
 
+    def __iter__(self):
+        for f in sorted(self._manifest):
+            yield f
+
     @propertycache
     def substate(self):
         return subrepo.state(self, self._repo.ui)
 
     def rev(self):
@@ -195,14 +199,10 @@ 
         p = self._repo.changelog.parentrevs(self._rev)
         if p[1] == nullrev:
             p = p[:-1]
         return [changectx(self._repo, x) for x in p]
 
-    def __iter__(self):
-        for f in sorted(self._manifest):
-            yield f
-
     def changeset(self):
         return self._changeset
     def manifest(self):
         return self._manifest
     def manifestnode(self):