[Updated] D8998: git: make dirstate actually support listclean parameter

durin42 (Augie Fackler) phabricator at mercurial-scm.org
Tue Sep 8 12:07:50 UTC 2020


Closed by commit rHGb30c182e7c07: git: make dirstate actually support listclean parameter (authored by durin42).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D8998?vs=22563&id=22573

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8998/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8998

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
@@ -129,6 +129,7 @@
             return False
 
     def status(self, match, subrepos, ignored, clean, unknown):
+        listignored, listclean, listunknown = ignored, clean, unknown
         # TODO handling of clean files - can we get that from git.status()?
         modified, added, removed, deleted, unknown, ignored, clean = (
             [],
@@ -168,6 +169,20 @@
                     b'unhandled case: status for %r is %r' % (path, status)
                 )
 
+        if listclean:
+            observed = set(modified + added + removed + deleted + unknown + ignored)
+            index = self.git.index
+            index.read()
+            for entry in index:
+                path = pycompat.fsencode(entry.path)
+                if not match(path):
+                    continue
+                if path in observed:
+                    continue # already in some other set
+                if path[-1] == b'/':
+                    continue # directory
+                clean.append(path)
+
         # TODO are we really always sure of status here?
         return (
             False,



To: durin42, #hg-reviewers, pulkit
Cc: mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20200908/a34661c2/attachment-0002.html>


More information about the Mercurial-patches mailing list