Author name substitution broken when author name contains '.' dot

Create issue
Issue #280 wontfix
Former user created an issue

The following line in {{{ self[author] = result = '%s%s' % (author, self.defaulthost) }}}

Replaces an unknown "author" with something like "author@123-123-123", but if author name contains '.' dot mercurial GUI will render it erroneously. For instance, I'm getting for "" only "alex" in the GUI.

That's not a problem in case you are using full names, but in our company we have all names in form like "" and all authors names in GUI are shortened to just single letter, which is not very handy.

We patched our code to return '%s' instead of existing pattern, but I'm wondering: is it possible to make the same thing in the hgsubversion trunk - or at least to replace this pattern with some other, that will not have the "single author name letter" issue?

Thanks in advance!

Comments (4)

  1. Former user Account Deleted

    Here is our patch for this issue:

    diff -r 0b07a0c574bc hgsubversion/
    --- a/hgsubversion/  Tue May 24 16:08:17 2011 -0500
    +++ b/hgsubversion/  Wed May 25 16:18:10 2011 +0400
    @@ -80,7 +80,7 @@
             if author in self:
                 result = self.super.__getitem__(author)
             elif self.ui.configbool('hgsubversion', 'defaultauthors', True):
    -            self[author] = result = '%s%s' % (author, self.defaulthost)
    +            self[author] = result = '%s <>' % (author)
                 msg = 'substituting author "%s" for default "%s"\n'
                 self.ui.note(msg % (author, result))
  2. Dan Villiom Podlaski Christiansen

    That patch is incorrect: it will break the ‘hgsubversion.defaulthost’ option. Also, your proposed patch will cause all users to be listed as ‘no’ or ‘’ in any command that uses either the email account or full email address, such as ‘hg annotate’. Finally, you haven't explained what bug you see *in hgsubversion*.

    Yes, Mercurial considers ‘x’ in ‘’ as the account. I agree that it's unfortunate, but that doesn't make it a bug when hgsubversion retains such accounts from Subversion.

    If you want fine-grained control over the author names, you should write up a authormap — this will allow you to convert every Subversion author into something of your choosing.

  3. Former user Account Deleted

    We have a lot of authors and new ones are joining us frequently, so regeneration of authors map is often and annoying procedure that we want to avoid.

    Is there any possibility to improve my patch? For instance, we could use something like '%s <%s@%s>' % (author, author, self.defaulthost) - to fix email related functionality and remove GUI issues.

  4. Augie Fackler repo owner

    If you want to discuss this at length, the Google Group is the place, not the bug tracker.

  5. Log in to comment