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
def get_symbol(self, symbol, stats): if isinstance(symbol, (Trunk, TypedSymbol)): return symbol elif stats.tag_create_count >= stats.branch_create_count: return Tag(symbol) else: return Branch(symbol)
def get_symbol(self, symbol, stats): if isinstance(symbol, (Trunk, TypedSymbol)): return symbol else: Log().verbose( 'Converting symbol %s as a tag because no other rules applied.' % (symbol, )) return Tag(symbol)
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)
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
def convert_as_tag(symbol): logger.verbose('Converting symbol %s as a tag because of manual setting.' % (symbol, )) return Tag(symbol)
def get_symbol(self, symbol, stats): if isinstance(symbol, (Trunk, TypedSymbol)): return symbol else: return Tag(symbol)