Issue #280 wontfix

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

Alexander Buryak
created an issue

The following line in maps.py:83 {{{ 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 "alex.black" 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 "a.black" and all authors names in GUI are shortened to just single letter, which is not very handy.

We patched our code to return '%s no@mail.com' 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. Alexander Buryak reporter

    Here is our patch for this issue:

    diff -r 0b07a0c574bc hgsubversion/maps.py
    --- a/hgsubversion/maps.py  Tue May 24 16:08:17 2011 -0500
    +++ b/hgsubversion/maps.py  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 <no@mail.com>' % (author)
                 msg = 'substituting author "%s" for default "%s"\n'
                 self.ui.note(msg % (author, result))
             else:
    
  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 ‘no@mail.com’ 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 ‘x.y@z.com’ 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. Alexander Buryak reporter

    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. Log in to comment