mercurial/version.py
changeset 5481 003d1f174fe1
parent 4066 cff3e4b4a8de
child 5931 6482d34974ac
equal deleted inserted replaced
5480:81bef3c355c5 5481:003d1f174fe1
    48 
    48 
    49 def remember_version(version=None):
    49 def remember_version(version=None):
    50     """Store version information."""
    50     """Store version information."""
    51     global remembered_version
    51     global remembered_version
    52     if not version and os.path.isdir(".hg"):
    52     if not version and os.path.isdir(".hg"):
    53         f = os.popen("hg identify 2> %s" % util.nulldev)  # use real hg installation
    53         f = util.popen("hg identify")  # use real hg installation
    54         ident = f.read()[:-1]
    54         ident = f.read()[:-1]
    55         if not f.close() and ident:
    55         if not f.close() and ident:
    56             ids = ident.split(' ', 1)
    56             ids = ident.split(' ', 1)
    57             version = ids.pop(0)
    57             version = ids.pop(0)
    58             if version[-1] == '+':
    58             if version[-1] == '+':