Project

General

Profile

« Previous | Next » 

Revision 2985

sql_gen.py: concat(): Consider ")"s part of the existing suffix, so that parentheses match up

View differences:

lib/sql_gen.py
22 22
    '''Preserves version so that it won't be truncated off the string, leading
23 23
    to collisions.'''
24 24
    # Preserve version
25
    before, sep, version = str_.rpartition('#')
26
    if sep != '': # found match
27
        str_ = before
28
        suffix = sep+version+suffix
25
    match = re.match(r'^(.*?)((?:(?:#\d+)?\)?)+)$', str_)
26
    if match:
27
        str_, old_suffix = match.groups()
28
        suffix = old_suffix+suffix
29 29
    
30 30
    return strings.concat(str_, suffix, identifier_max_len)
31 31

  

Also available in: Unified diff