# HG changeset patch # User Dan Villiom Podlaski Christiansen # Date 1238119182 -3600 # Node ID 3e27514d575cabd9f0338b4c5ffe34dc59bb2297 # Parent 32d3f1716e668c9dec0102f0ef9c2edbb4ca17e5 Use a reverse lookup in authormap to determine the author for 'hg svn info'. We don't use util.shortuser(); it breaks stuff by cropping the user name at the first period even if it's part of the name. diff --git a/hg_delta_editor.py b/hg_delta_editor.py --- a/hg_delta_editor.py +++ b/hg_delta_editor.py @@ -692,6 +692,14 @@ class HgChangeReceiver(delta.Editor): return self.authors[author] return '%s%s' %(author, self.author_host) + def svnauthorforauthor(self, author): + for svnauthor, hgauthor in self.authors.iteritems(): + if author == hgauthor: + return svnauthor + else: + # Mercurial incorrectly splits at e.g. '.', so we roll our own. + return author.rsplit('@', 1)[0] + def readauthors(self, authorfile): self.ui.note(('Reading authormap from %s\n') % authorfile) f = open(authorfile, 'r') diff --git a/utility_commands.py b/utility_commands.py --- a/utility_commands.py +++ b/utility_commands.py @@ -85,7 +85,7 @@ def run_svn_info(ui, repo, hg_repo_path, if url[-1] == '/': url = url[:-1] url = '%s%s' % (url, branchpath) - author = '@'.join(parent.user().split('@')[:-1]) + author = hge.svnauthorforauthor(parent.user()) # cleverly figure out repo root w/o actually contacting the server reporoot = url[:len(url)-len(subdir)] ui.status('''URL: %(url)s