Changeset 459
- Timestamp:
- 08-01-10 17:56:56 (3 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
moap/vcs/git.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ChangeLog
r456 r459 1 2010-01-08 Thomas Vander Stichele <thomas at apestaart dot org> 2 3 patch by: Jan Urbanski 4 5 * moap/vcs/git.py: 6 support added and deleted files in Git. 7 Fixes #413. 8 1 9 2009-12-28 Thomas Vander Stichele <thomas at apestaart dot org> 2 10 -
trunk/moap/vcs/git.py
r419 r459 46 46 os.chdir(oldPath) 47 47 return result 48 49 def _getByStatus(self, path, status): 50 ret = [] 51 oldPath = os.getcwd() 52 53 os.chdir(path) 54 cmd = "git diff --cached --diff-filter=%s --raw" % status 55 output = commands.getoutput(cmd) 56 lines = output.split("\n") 57 58 matcher = re.compile(r'^:.*\.\.\. ' + status + '\s+(.*)') 59 for l in lines: 60 m = matcher.search(l) 61 if m: 62 relpath = m.expand("\\1") 63 ret.append(relpath) 64 65 # FIXME: would be nice to sort per directory 66 os.chdir(oldPath) 67 return ret 68 69 def getAdded(self, path): 70 return self._getByStatus(path, 'A') 71 72 def getDeleted(self, path): 73 return self._getByStatus(path, 'D') 48 74 49 75 def ignore(self, paths, commit=True): … … 103 129 self.debug('frobnicated path to %s' % path) 104 130 105 cmd = "git diff --cached -- %s" % path131 cmd = "git diff --cached --diff-filter=M -- %s" % path 106 132 self.debug("Running %s" % cmd) 107 133 output = commands.getoutput(cmd)
Note: See TracChangeset
for help on using the changeset viewer.
