Skip to content

Commit

Permalink
Merge pull request #62 from linzhp/feature/content_extension
Browse files Browse the repository at this point in the history
Feature/content extension
  • Loading branch information
sduenas committed Mar 31, 2014
2 parents 1f2d1b2 + af146b5 commit e2d2630
Show file tree
Hide file tree
Showing 2 changed files with 450 additions and 2 deletions.
13 changes: 11 additions & 2 deletions pycvsanaly2/GitParser.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def set_tail(self, tail):
patterns['committer'] = re.compile("^Commit:[ \t]+(.*)[ \t]+<(.*)>$")
patterns['date'] = re.compile(
"^CommitDate: (.* [0-9]+ [0-9]+:[0-9]+:[0-9]+ [0-9][0-9][0-9][0-9]) ([+-][0-9][0-9][0-9][0-9])$")
patterns['file'] = re.compile("^([MAD])[ \t]+(.*)$")
patterns['file'] = re.compile("^([MAD]+)[ \t]+(.*)$")
patterns['file-moved'] = re.compile("^([RC])[0-9]+[ \t]+(.*)[ \t]+(.*)$")
patterns['branch'] = re.compile("refs/remotes/origin/([^,]*)")
patterns['local-branch'] = re.compile("refs/heads/([^,]*)")
Expand Down Expand Up @@ -237,7 +237,16 @@ def _parse_line(self, line):
match = self.patterns['file'].match(line)
if match:
action = Action()
action.type = match.group(1)
type = match.group(1)
if len(type) > 1:
# merge actions
if 'M' in type:
type = 'M'
else:
# ignore merge actions without 'M'
return

action.type = type
action.f1 = match.group(2)

self.commit.actions.append(action)
Expand Down
Loading

0 comments on commit e2d2630

Please sign in to comment.