hgext/churn.py
changeset 19464 68f7129af6a8
parent 18369 2150e70c0ee1
child 19959 9ef92384415c
equal deleted inserted replaced
19463:f3393d458bf5 19464:68f7129af6a8
   119 
   119 
   120       <alias email> = <actual email>
   120       <alias email> = <actual email>
   121 
   121 
   122     Such a file may be specified with the --aliases option, otherwise
   122     Such a file may be specified with the --aliases option, otherwise
   123     a .hgchurn file will be looked for in the working directory root.
   123     a .hgchurn file will be looked for in the working directory root.
       
   124     Aliases will be split from the rightmost "=".
   124     '''
   125     '''
   125     def pad(s, l):
   126     def pad(s, l):
   126         return (s + " " * l)[:l]
   127         return (s + " " * l)[:l]
   127 
   128 
   128     amap = {}
   129     amap = {}
   130     if not aliases and os.path.exists(repo.wjoin('.hgchurn')):
   131     if not aliases and os.path.exists(repo.wjoin('.hgchurn')):
   131         aliases = repo.wjoin('.hgchurn')
   132         aliases = repo.wjoin('.hgchurn')
   132     if aliases:
   133     if aliases:
   133         for l in open(aliases, "r"):
   134         for l in open(aliases, "r"):
   134             try:
   135             try:
   135                 alias, actual = l.split('=' in l and '=' or None, 1)
   136                 alias, actual = l.rsplit('=' in l and '=' or None, 1)
   136                 amap[alias.strip()] = actual.strip()
   137                 amap[alias.strip()] = actual.strip()
   137             except ValueError:
   138             except ValueError:
   138                 l = l.strip()
   139                 l = l.strip()
   139                 if l:
   140                 if l:
   140                     ui.warn(_("skipping malformed alias: %s\n") % l)
   141                     ui.warn(_("skipping malformed alias: %s\n") % l)