improved git mode

--HG--
branch : pmacs2
This commit is contained in:
Erik Osheim 2011-08-17 23:55:24 -04:00
parent 809ac2f3f8
commit 8a24c92379
1 changed files with 16 additions and 16 deletions

View File

@ -173,7 +173,7 @@ class GitDiff(Method):
# w.set_error("No difference found") # w.set_error("No difference found")
class GitBlame(VcBlame): class GitBlame(VcBlame):
'''show blame output for the current version in SVN''' '''show blame output for the current version in Git'''
# rev, user, date, [time], [timezone], [date-str], content # rev, user, date, [time], [timezone], [date-str], content
num_fields = 3 num_fields = 3
line_re = re.compile(r'^\^*([0-9a-f]+) \(([a-zA-Z0-9_ ]+|Not Committed Yet) +([-0-9]+) [:0-9]+ +[-\+]\d{4} +\d+\) (.*)\n$') line_re = re.compile(r'^\^*([0-9a-f]+) \(([a-zA-Z0-9_ ]+|Not Committed Yet) +([-0-9]+) [:0-9]+ +[-\+]\d{4} +\d+\) (.*)\n$')
@ -197,18 +197,18 @@ class GitBlame(VcBlame):
cmd = ("git", 'blame', w.buffer.path) cmd = ("git", 'blame', w.buffer.path)
return Popen(cmd, stdin=PIPE, stdout=PIPE, stderr=PIPE) return Popen(cmd, stdin=PIPE, stdout=PIPE, stderr=PIPE)
#class GitBlame2(GitBlame): class GitBlame2(GitBlame):
# '''show file contents in SVN at revision''' '''show blame output for the specific revision in Git'''
# args = [arg("revision", t=type(""), p="Revision: ", h="revision number")] args = [arg("revision", t=type(""), p="Revision: ", h="revision number")]
# def _open_pipe(self, w, **vargs): def _open_pipe(self, w, **vargs):
# cmd = ("git", 'blame', '-v', '-r', vargs['revision'], w.buffer.path) cmd = ("git", 'blame', vargs['revision'], w.buffer.path)
# return Popen(cmd, stdin=PIPE, stdout=PIPE, stderr=PIPE) return Popen(cmd, stdin=PIPE, stdout=PIPE, stderr=PIPE)
#
#class GitRevView(VcRevView): class GitRevView(VcRevView):
# '''show file contents in SVN at date''' '''show file contents in Git at revision'''
# args = [arg("revision", t=type(""), p="Revision: ", h="revision number")] args = [arg("revision", t=type(""), p="Revision: ", h="revision number")]
# namebase = 'SVN' namebase = 'Git'
# _is_method = True _is_method = True
# def _get_cmd(self, w, **vargs): def _get_cmd(self, w, **vargs):
# path = self._get_path(w, **vargs) path = self._get_path(w, **vargs)
# return ("git", 'cat', '-r', vargs['revision'], path) return ("git", 'show', vargs['revision'] + ':' + path)