Show More
@@ -9,14 +9,7 b' from node import nullid, nullrev, short,' | |||
|
9 | 9 | from i18n import _ |
|
10 | 10 | import ancestor, bdiff, error, util, os, errno |
|
11 | 11 | |
|
12 | class propertycache(object): | |
|
13 | def __init__(self, func): | |
|
14 | self.func = func | |
|
15 | self.name = func.__name__ | |
|
16 | def __get__(self, obj, type=None): | |
|
17 | result = self.func(obj) | |
|
18 | setattr(obj, self.name, result) | |
|
19 | return result | |
|
12 | propertycache = util.propertycache | |
|
20 | 13 | |
|
21 | 14 | class changectx(object): |
|
22 | 15 | """A changecontext object makes access to data related to a particular |
@@ -137,6 +137,15 b' def cachefunc(func):' | |||
|
137 | 137 | |
|
138 | 138 | return f |
|
139 | 139 | |
|
140 | class propertycache(object): | |
|
141 | def __init__(self, func): | |
|
142 | self.func = func | |
|
143 | self.name = func.__name__ | |
|
144 | def __get__(self, obj, type=None): | |
|
145 | result = self.func(obj) | |
|
146 | setattr(obj, self.name, result) | |
|
147 | return result | |
|
148 | ||
|
140 | 149 | def pipefilter(s, cmd): |
|
141 | 150 | '''filter string S through command CMD, returning its output''' |
|
142 | 151 | (pin, pout) = popen2(cmd, 'b') |
General Comments 0
You need to be logged in to leave comments.
Login now