<s> import re <EOL> repo = None <EOL> version = None <EOL> try : <EOL> import hgversion as hgv <EOL> except ImportError : <EOL> pass <EOL> else : <EOL> repo = hgv . repository <EOL> if repo is None : <EOL> try : <EOL> f = open ( '<STR_LIT>' ) <EOL> except IOError : <EOL> pass <EOL> else : <EOL> regex = re . compile ( '<STR_LIT>' ) <EOL> for line in f : <EOL> mo = regex . match ( line ) <EOL> if mo is not None : <EOL> version = mo . group ( <NUM_LIT:1> ) <EOL> break <EOL> else : <EOL> version = hgv . version ( ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> print version </s>
