D8996: git: fix up dirstate use of index
durin42 (Augie Fackler)
phabricator at mercurial-scm.org
Mon Sep 7 21:31:21 UTC 2020
durin42 created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.
REVISION SUMMARY
This was super-broken before, and somehow none of the existing
attempts to use this code tripped on the defects here. Sigh.
REPOSITORY
rHG Mercurial
BRANCH
default
REVISION DETAIL
https://phab.mercurial-scm.org/D8996
AFFECTED FILES
hgext/git/dirstate.py
CHANGE DETAILS
diff --git a/hgext/git/dirstate.py b/hgext/git/dirstate.py
--- a/hgext/git/dirstate.py
+++ b/hgext/git/dirstate.py
@@ -276,13 +276,22 @@
pass
def add(self, f):
- self.git.index.add(pycompat.fsdecode(f))
+ index = self.git.index
+ index.read()
+ index.add(pycompat.fsdecode(f))
+ index.write()
def drop(self, f):
- self.git.index.remove(pycompat.fsdecode(f))
+ index = self.git.index
+ index.read()
+ index.remove(pycompat.fsdecode(f))
+ index.write()
def remove(self, f):
- self.git.index.remove(pycompat.fsdecode(f))
+ index = self.git.index
+ index.read()
+ index.remove(pycompat.fsdecode(f))
+ index.write()
def copied(self, path):
# TODO: track copies?
To: durin42, #hg-reviewers
Cc: mercurial-patches, mercurial-devel
More information about the Mercurial-devel
mailing list