comparison hgsubversion/maps.py @ 1195:a5641006e338

maps: use meta.defaultauthors intead of accessing ui directly
author Sean Farley <sean.michael.farley@gmail.com>
date Mon, 24 Mar 2014 11:20:46 -0500
parents 49791c40a8a5
children 878372849175
comparison
equal deleted inserted replaced
1194:49791c40a8a5 1195:a5641006e338
26 26
27 The path argument is the location of the backing store, 27 The path argument is the location of the backing store,
28 typically .hg/svn/authors. 28 typically .hg/svn/authors.
29 ''' 29 '''
30 self.meta = meta 30 self.meta = meta
31 self.use_defaultauthors = self.meta.ui.configbool('hgsubversion', 'defaultauthors', True)
32 self.caseignoreauthors = self.meta.ui.configbool('hgsubversion', 'caseignoreauthors', False) 31 self.caseignoreauthors = self.meta.ui.configbool('hgsubversion', 'caseignoreauthors', False)
33 self.defaulthost = '' 32 self.defaulthost = ''
34 if meta.defaulthost: 33 if meta.defaulthost:
35 self.defaulthost = '@%s' % meta.defaulthost.lstrip('@') 34 self.defaulthost = '@%s' % meta.defaulthost.lstrip('@')
36 35
101 else: 100 else:
102 search_author = author 101 search_author = author
103 102
104 if search_author in self: 103 if search_author in self:
105 result = self.super.__getitem__(search_author) 104 result = self.super.__getitem__(search_author)
106 elif self.use_defaultauthors: 105 elif self.meta.defaultauthors:
107 self[author] = result = '%s%s' % (author, self.defaulthost) 106 self[author] = result = '%s%s' % (author, self.defaulthost)
108 msg = 'substituting author "%s" for default "%s"\n' 107 msg = 'substituting author "%s" for default "%s"\n'
109 self.meta.ui.debug(msg % (author, result)) 108 self.meta.ui.debug(msg % (author, result))
110 else: 109 else:
111 msg = 'author %s has no entry in the author map!' 110 msg = 'author %s has no entry in the author map!'