# HG changeset patch # User Dan Villiom Podlaski Christiansen # Date 1238119182 -3600 # Node ID bb2b78f9f4cef0c3ebbe2b73e4a4f2a1a952993b # Parent 2117cb0118fe72f3aaa0da35bfe8598dda28fc1b Use a reverse lookup in authormap to determine the author for 'hg svn info'. diff --git a/hg_delta_editor.py b/hg_delta_editor.py --- a/hg_delta_editor.py +++ b/hg_delta_editor.py @@ -689,6 +689,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: + # return the original svn-side author + 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