Mercurial > hg
comparison hgext/convert/cvs.py @ 7441:4fecd17f2de9
convert cvs: Fix branch name parsing
cvsps version 2.2b1 as found in Fedora 10 outputs the following format:
---------------------
PatchSet 1
Date: 2008/11/26 00:59:46
Author: mk
Branch: HEAD
Tag: (none)
Branches: INITIAL
Log:
Initial revision
Members:
a:INITIAL->1.1
b/c:INITIAL->1.1
---------------------
The parser overwrote the Branch value with noise from the misparsed Branches
value.
author | Mads Kiilerich <mads@kiilerich.com> |
---|---|
date | Thu, 27 Nov 2008 22:04:51 +0100 |
parents | 4674706b5b95 |
children | a14ce129cfcd |
comparison
equal
deleted
inserted
replaced
7440:d2a917b27152 | 7441:4fecd17f2de9 |
---|---|
101 if l.startswith("PatchSet"): | 101 if l.startswith("PatchSet"): |
102 id = l[9:-2] | 102 id = l[9:-2] |
103 if maxrev and int(id) > maxrev: | 103 if maxrev and int(id) > maxrev: |
104 # ignore everything | 104 # ignore everything |
105 state = 3 | 105 state = 3 |
106 elif l.startswith("Date"): | 106 elif l.startswith("Date:"): |
107 date = util.parsedate(l[6:-1], ["%Y/%m/%d %H:%M:%S"]) | 107 date = util.parsedate(l[6:-1], ["%Y/%m/%d %H:%M:%S"]) |
108 date = util.datestr(date) | 108 date = util.datestr(date) |
109 elif l.startswith("Branch"): | 109 elif l.startswith("Branch:"): |
110 branch = l[8:-1] | 110 branch = l[8:-1] |
111 self.parent[id] = self.lastbranch.get(branch, 'bad') | 111 self.parent[id] = self.lastbranch.get(branch, 'bad') |
112 self.lastbranch[branch] = id | 112 self.lastbranch[branch] = id |
113 elif l.startswith("Ancestor branch"): | 113 elif l.startswith("Ancestor branch:"): |
114 ancestor = l[17:-1] | 114 ancestor = l[17:-1] |
115 # figure out the parent later | 115 # figure out the parent later |
116 self.parent[id] = self.lastbranch[ancestor] | 116 self.parent[id] = self.lastbranch[ancestor] |
117 elif l.startswith("Author"): | 117 elif l.startswith("Author:"): |
118 author = self.recode(l[8:-1]) | 118 author = self.recode(l[8:-1]) |
119 elif l.startswith("Tag:") or l.startswith("Tags:"): | 119 elif l.startswith("Tag:") or l.startswith("Tags:"): |
120 t = l[l.index(':')+1:] | 120 t = l[l.index(':')+1:] |
121 t = [ut.strip() for ut in t.split(',')] | 121 t = [ut.strip() for ut in t.split(',')] |
122 if (len(t) > 1) or (t[0] and (t[0] != "(none)")): | 122 if (len(t) > 1) or (t[0] and (t[0] != "(none)")): |