patch: enable meld to recognise all git status codes



running recent versions of meld on my git repository has been failing with this traceback:
  File "/usr/local/lib/meld/meld/task.py", line 112, in iteration
    ret = next(task)
  File "/usr/local/lib/meld/meld/vcview.py", line 447, in _search_recursively_iter
    self.vc.cache_inventory(rootname)
  File "/usr/local/lib/meld/meld/vc/_vc.py", line 275, in cache_inventory
    self._tree_cache = self._lookup_tree_cache(directory)
  File "/usr/local/lib/meld/meld/vc/git.py", line 348, in _lookup_tree_cache
    self._update_tree_state_cache("./", tree_state)
  File "/usr/local/lib/meld/meld/vc/git.py", line 324, in _update_tree_state_cache
    columns = self.diff_re.search(entry).groups()
AttributeError: 'NoneType' object has no attribute 'groups'

This is because meld does not recognise the full set of status codes output by `git diff-index` - the regex used does not recogise the 'T' or 'X' codes. This patch fixes this.


diff --git c/meld/vc/git.py i/meld/vc/git.py
index 5949951..5db2063 100644
--- c/meld/vc/git.py
+++ i/meld/vc/git.py
@@ -45,7 +45,7 @@ class Vc(_vc.CachedVc):
 
     VC_COLUMNS = (_vc.DATA_NAME, _vc.DATA_STATE, _vc.DATA_OPTIONS)
 
-    GIT_DIFF_FILES_RE = ":(\d+) (\d+) [a-z0-9]+ [a-z0-9]+ ([ADMU])\t(.*)"
+    GIT_DIFF_FILES_RE = ":(\d+) (\d+) [a-z0-9]+ [a-z0-9]+ ([XADMTU])\t(.*)"
     DIFF_RE = re.compile(GIT_DIFF_FILES_RE)
 
     conflict_map = {



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