Example #1
0
 def get_symbol(self, symbol, stats):
     if isinstance(symbol, (Trunk, TypedSymbol)):
         return symbol
     elif stats.branch_commit_count > 0:
         return Branch(symbol)
     else:
         return symbol
Example #2
0
 def get_symbol(self, symbol, stats):
     if isinstance(symbol, (Trunk, TypedSymbol)):
         return symbol
     else:
         Log().verbose(
             'Converting symbol %s as a branch because no other rules applied.'
             % (symbol, ))
         return Branch(symbol)
Example #3
0
 def get_symbol(self, symbol, stats):
     if isinstance(symbol, (Trunk, TypedSymbol)):
         return symbol
     elif stats.branch_commit_count > 0:
         logger.verbose(
             'Converting symbol %s as a branch because there are commits on it.'
             % (symbol, ))
         return Branch(symbol)
     else:
         return symbol
Example #4
0
 def get_symbol(self, symbol, stats):
     if isinstance(symbol, (Trunk, TypedSymbol)):
         return symbol
     elif stats.tag_create_count >= stats.branch_create_count:
         logger.verbose(
             'Converting symbol %s as a tag because it is more often used '
             'as a tag.' % (symbol, ))
         return Tag(symbol)
     else:
         logger.verbose(
             'Converting symbol %s as a branch because it is more often used '
             'as a branch.' % (symbol, ))
         return Branch(symbol)
Example #5
0
 def get_symbol(self, symbol, stats):
     if isinstance(symbol, (Trunk, TypedSymbol)):
         return symbol
     is_tag = stats.tag_create_count > 0
     is_branch = stats.branch_create_count > 0 or stats.branch_commit_count > 0
     if is_tag and is_branch:
         # Can't decide
         return symbol
     elif is_branch:
         return Branch(symbol)
     elif is_tag:
         return Tag(symbol)
     else:
         # The symbol didn't appear at all:
         return symbol
Example #6
0
 def get_symbol(self, symbol, stats):
     if isinstance(symbol, (Trunk, TypedSymbol)):
         return symbol
     is_tag = stats.tag_create_count > 0
     is_branch = stats.branch_create_count > 0 or stats.branch_commit_count > 0
     if is_tag and is_branch:
         # Can't decide
         return symbol
     elif is_branch:
         logger.verbose(
             'Converting symbol %s as a branch because it is always used '
             'as a branch.' % (symbol, ))
         return Branch(symbol)
     elif is_tag:
         logger.verbose(
             'Converting symbol %s as a tag because it is always used '
             'as a tag.' % (symbol, ))
         return Tag(symbol)
     else:
         # The symbol didn't appear at all:
         return symbol
Example #7
0
def convert_as_branch(symbol):
    logger.verbose(
        'Converting symbol %s as a branch because of manual setting.' %
        (symbol, ))
    return Branch(symbol)
Example #8
0
 def get_symbol(self, symbol, stats):
     if isinstance(symbol, (Trunk, TypedSymbol)):
         return symbol
     else:
         return Branch(symbol)