Show More
@@ -74,6 +74,8 b' class gitdirstate(object):' | |||||
74 | self._root = os.path.dirname(root) |
|
74 | self._root = os.path.dirname(root) | |
75 | self.git = gitrepo |
|
75 | self.git = gitrepo | |
76 | self._plchangecallbacks = {} |
|
76 | self._plchangecallbacks = {} | |
|
77 | # TODO: context.poststatusfixup is bad and uses this attribute | |||
|
78 | self._dirty = False | |||
77 |
|
79 | |||
78 | def p1(self): |
|
80 | def p1(self): | |
79 | try: |
|
81 | try: | |
@@ -255,12 +257,12 b' class gitdirstate(object):' | |||||
255 | if match(p): |
|
257 | if match(p): | |
256 | yield p |
|
258 | yield p | |
257 |
|
259 | |||
258 |
def |
|
260 | def set_clean(self, f, parentfiledata=None): | |
259 | """Mark a file normal and clean.""" |
|
261 | """Mark a file normal and clean.""" | |
260 | # TODO: for now we just let libgit2 re-stat the file. We can |
|
262 | # TODO: for now we just let libgit2 re-stat the file. We can | |
261 | # clearly do better. |
|
263 | # clearly do better. | |
262 |
|
264 | |||
263 |
def |
|
265 | def set_possibly_dirty(self, f): | |
264 | """Mark a file normal, but possibly dirty.""" |
|
266 | """Mark a file normal, but possibly dirty.""" | |
265 | # TODO: for now we just let libgit2 re-stat the file. We can |
|
267 | # TODO: for now we just let libgit2 re-stat the file. We can | |
266 | # clearly do better. |
|
268 | # clearly do better. | |
@@ -296,6 +298,16 b' class gitdirstate(object):' | |||||
296 | # TODO: figure out a strategy for saving index backups. |
|
298 | # TODO: figure out a strategy for saving index backups. | |
297 | pass |
|
299 | pass | |
298 |
|
300 | |||
|
301 | def set_tracked(self, f): | |||
|
302 | uf = pycompat.fsdecode(f) | |||
|
303 | if uf in self.git.index: | |||
|
304 | return False | |||
|
305 | index = self.git.index | |||
|
306 | index.read() | |||
|
307 | index.add(uf) | |||
|
308 | index.write() | |||
|
309 | return True | |||
|
310 | ||||
299 | def add(self, f): |
|
311 | def add(self, f): | |
300 | index = self.git.index |
|
312 | index = self.git.index | |
301 | index.read() |
|
313 | index.read() | |
@@ -310,6 +322,16 b' class gitdirstate(object):' | |||||
310 | index.remove(fs) |
|
322 | index.remove(fs) | |
311 | index.write() |
|
323 | index.write() | |
312 |
|
324 | |||
|
325 | def set_untracked(self, f): | |||
|
326 | index = self.git.index | |||
|
327 | index.read() | |||
|
328 | fs = pycompat.fsdecode(f) | |||
|
329 | if fs in index: | |||
|
330 | index.remove(fs) | |||
|
331 | index.write() | |||
|
332 | return True | |||
|
333 | return False | |||
|
334 | ||||
313 | def remove(self, f): |
|
335 | def remove(self, f): | |
314 | index = self.git.index |
|
336 | index = self.git.index | |
315 | index.read() |
|
337 | index.read() | |
@@ -324,6 +346,10 b' class gitdirstate(object):' | |||||
324 | # TODO |
|
346 | # TODO | |
325 | pass |
|
347 | pass | |
326 |
|
348 | |||
|
349 | def update_file(self, *args, **kwargs): | |||
|
350 | # TODO | |||
|
351 | pass | |||
|
352 | ||||
327 | @contextlib.contextmanager |
|
353 | @contextlib.contextmanager | |
328 | def parentchange(self): |
|
354 | def parentchange(self): | |
329 | # TODO: track this maybe? |
|
355 | # TODO: track this maybe? |
General Comments 0
You need to be logged in to leave comments.
Login now