Show More
@@ -265,6 +265,11 b' class gitdirstate:' | |||||
265 | # correctly stage/revert index edits. |
|
265 | # correctly stage/revert index edits. | |
266 | return False |
|
266 | return False | |
267 |
|
267 | |||
|
268 | def is_changing_any(self): | |||
|
269 | # TODO: we need to implement the context manager bits and | |||
|
270 | # correctly stage/revert index edits. | |||
|
271 | return False | |||
|
272 | ||||
268 | def write(self, tr): |
|
273 | def write(self, tr): | |
269 | # TODO: call parent change callbacks |
|
274 | # TODO: call parent change callbacks | |
270 |
|
275 |
@@ -202,6 +202,14 b' class dirstate:' | |||||
202 | ) |
|
202 | ) | |
203 | raise error.ProgrammingError(msg) |
|
203 | raise error.ProgrammingError(msg) | |
204 |
|
204 | |||
|
205 | @property | |||
|
206 | def is_changing_any(self): | |||
|
207 | """Returns true if the dirstate is in the middle of a set of changes. | |||
|
208 | ||||
|
209 | This returns True for any kind of change. | |||
|
210 | """ | |||
|
211 | return self._changing_level > 0 | |||
|
212 | ||||
205 | def pendingparentchange(self): |
|
213 | def pendingparentchange(self): | |
206 | """Returns true if the dirstate is in the middle of a set of changes |
|
214 | """Returns true if the dirstate is in the middle of a set of changes | |
207 | that modify the dirstate parent. |
|
215 | that modify the dirstate parent. |
@@ -24,6 +24,9 b' class idirstate(interfaceutil.Interface)' | |||||
24 | # TODO: all these private methods and attributes should be made |
|
24 | # TODO: all these private methods and attributes should be made | |
25 | # public or removed from the interface. |
|
25 | # public or removed from the interface. | |
26 | _ignore = interfaceutil.Attribute("""Matcher for ignored files.""") |
|
26 | _ignore = interfaceutil.Attribute("""Matcher for ignored files.""") | |
|
27 | is_changing_any = interfaceutil.Attribute( | |||
|
28 | """True if any changes in progress.""" | |||
|
29 | ) | |||
27 | is_changing_parents = interfaceutil.Attribute( |
|
30 | is_changing_parents = interfaceutil.Attribute( | |
28 | """True if parents changes in progress.""" |
|
31 | """True if parents changes in progress.""" | |
29 | ) |
|
32 | ) |
@@ -3070,7 +3070,7 b' class localrepository:' | |||||
3070 | self.ui.develwarn(b'"wlock" acquired after "lock"') |
|
3070 | self.ui.develwarn(b'"wlock" acquired after "lock"') | |
3071 |
|
3071 | |||
3072 | def unlock(): |
|
3072 | def unlock(): | |
3073 |
if self.dirstate.is_changing_ |
|
3073 | if self.dirstate.is_changing_any: | |
3074 | msg = b"wlock release in the middle of a changing parents" |
|
3074 | msg = b"wlock release in the middle of a changing parents" | |
3075 | self.ui.develwarn(msg) |
|
3075 | self.ui.develwarn(msg) | |
3076 | self.dirstate.invalidate() |
|
3076 | self.dirstate.invalidate() |
General Comments 0
You need to be logged in to leave comments.
Login now