[PATCH] convert: do not skip some lines in gnu arch summaries
Aleix Conchillo Flaque
aleix at member.fsf.org
Thu Feb 7 11:31:47 UTC 2008
# HG changeset patch
# User Aleix Conchillo Flaque <aleix at member.fsf.org>
# Date 1202383889 -3600
# Node ID 9360a58a09e6aa11d76a572304eafc6f5c765551
# Parent 6283316bcfd4d49a288c5f9bc034901b0f8c2b29
convert: do not skip some lines in gnu arch summaries
diff -r 6283316bcfd4 -r 9360a58a09e6 hgext/convert/gnuarch.py
--- a/hgext/convert/gnuarch.py Wed Feb 06 20:00:35 2008 -0800
+++ b/hgext/convert/gnuarch.py Thu Feb 07 12:31:29 2008 +0100
@@ -197,6 +197,8 @@
while len(contents) > 0:
c = contents.pop()
p = os.path.join(path, c)
+ # os.walk could be used, but here we avoid internal GNU
+ # Arch files and directories, thus saving a lot time.
if not self._exclude(p):
if os.path.isdir(p):
contents += [os.path.join(c, f) for f in os.listdir(p)]
@@ -217,22 +219,20 @@
return changes, copies
def _parsecatlog(self, data, rev):
- readingsummary = False
+ summary = []
for l in data:
l = l.strip()
- if l.startswith('Standard-date:'):
+ if summary:
+ summary.append(l)
+ elif l.startswith('Summary:'):
+ summary.append(l[len('Summary: '):])
+ elif l.startswith('Standard-date:'):
date = l[len('Standard-date: '):]
strdate = util.strdate(date, '%Y-%m-%d %H:%M:%S')
self.changes[rev].date = util.datestr(strdate)
-
- if l.startswith('Creator:'):
+ elif l.startswith('Creator:'):
self.changes[rev].author = l[len('Creator: '):]
-
- if not readingsummary and l.startswith('Summary:'):
- readingsummary = True
- self.changes[rev].summary = l[len('Summary: '):]
- elif not l.startswith('Keywords:'):
- self.changes[rev].summary += '\n%s' % l
+ self.changes[rev].summary = '\n'.join(summary)
def _parsedelta(self, data, rev):
for l in data:
More information about the Mercurial-devel
mailing list