[meld] Support unversioned files in git (closes bgo#662084)



commit 2edc30c616a799e990cf34b734e59b570ee229e0
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Wed Oct 19 06:51:25 2011 +1000

    Support unversioned files in git (closes bgo#662084)
    
    Neither git diff-index nor name-status give us information about
    untracked files within git. This commit adds an additional ls-files
    call to obtain a list of untracked/unversioned files.

 meld/vc/git.py |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/meld/vc/git.py b/meld/vc/git.py
index bfa5a7e..69dc5f3 100644
--- a/meld/vc/git.py
+++ b/meld/vc/git.py
@@ -46,6 +46,7 @@ class Vc(_vc.CachedVc):
         "T": _vc.STATE_MODIFIED, # Type-changed
         "U": _vc.STATE_CONFLICT, # Unmerged
         "I": _vc.STATE_IGNORED,  # Ignored (made-up status letter)
+        "?": _vc.STATE_NONE,     # Unversioned
     }
 
     def check_repo_root(self, location):
@@ -98,10 +99,16 @@ class Vc(_vc.CachedVc):
                     "-0", path], cwd=self.location)
                 entries += (proc.read().split("\n")[:-1])
 
+                # Identify ignored files
                 proc = _vc.popen([self.CMD, "ls-files", "--others", \
                     "--ignored", "--exclude-standard", path], cwd=self.location)
                 entries += ("I\t%s" % f for f in proc.read().split("\n")[:-1])
 
+                # Identify unversioned files
+                proc = _vc.popen([self.CMD, "ls-files", "--others", \
+                    "--exclude-standard", path], cwd=self.location)
+                entries += ("?\t%s" % f for f in proc.read().split("\n")[:-1])
+
                 # An unmerged file or a file that has been modified, added to
                 # git's index, then modified again would result in the file
                 # showing up in both the output of "diff-files" and



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]