##// END OF EJS Templates
convert: fix authormap handling of lines without '='...
Marti Raudsepp -
r7962:62154415 default
parent child Browse files
Show More
@@ -197,24 +197,28 b' class converter(object):'
197 197 def readauthormap(self, authorfile):
198 198 afile = open(authorfile, 'r')
199 199 for line in afile:
200
200 201 if line.strip() == '':
201 202 continue
203
202 204 try:
203 205 srcauthor, dstauthor = line.split('=', 1)
204 srcauthor = srcauthor.strip()
205 dstauthor = dstauthor.strip()
206 if srcauthor in self.authors and dstauthor != self.authors[srcauthor]:
207 self.ui.status(
208 _('Overriding mapping for author %s, was %s, will be %s\n')
209 % (srcauthor, self.authors[srcauthor], dstauthor))
210 else:
211 self.ui.debug(_('mapping author %s to %s\n')
212 % (srcauthor, dstauthor))
213 self.authors[srcauthor] = dstauthor
214 except IndexError:
215 self.ui.warn(
216 _('Ignoring bad line in author map file %s: %s\n')
217 % (authorfile, line.rstrip()))
206 except ValueError:
207 msg = _('Ignoring bad line in author map file %s: %s\n')
208 self.ui.warn(msg % (authorfile, line.rstrip()))
209 continue
210
211 srcauthor = srcauthor.strip()
212 dstauthor = dstauthor.strip()
213 if self.authors.get(srcauthor) in (None, dstauthor):
214 msg = _('mapping author %s to %s\n')
215 self.ui.debug(msg % (srcauthor, dstauthor))
216 self.authors[srcauthor] = dstauthor
217 continue
218
219 m = _('overriding mapping for author %s, was %s, will be %s\n')
220 self.ui.status(m % (srcauthor, self.authors[srcauthor], dstauthor))
221
218 222 afile.close()
219 223
220 224 def cachecommit(self, rev):
@@ -15,6 +15,8 b' cd ..'
15 15 # Explicit --authors
16 16 cat > authormap.txt <<EOF
17 17 user name = Long User Name
18
19 this line is ignored
18 20 EOF
19 21
20 22 hg convert --authors authormap.txt orig new
@@ -1,4 +1,5 b''
1 1 initializing destination new repository
2 Ignoring bad line in author map file authormap.txt: this line is ignored
2 3 scanning source...
3 4 sorting...
4 5 converting...
@@ -12,6 +13,7 b' user: Long User Name'
12 13 date: Thu Jan 01 00:00:00 1970 +0000
13 14 summary: foo
14 15
16 Ignoring bad line in author map file new/.hg/authormap: this line is ignored
15 17 scanning source...
16 18 sorting...
17 19 converting...
General Comments 0
You need to be logged in to leave comments. Login now