scripts/chg-len.py
changeset 285 d8dc5acf739b
parent 272 e63a95b68827
equal deleted inserted replaced
0:6bbe8375268b 1:7706526f1d8b
     7     print """
     7     print """
     8 This utility just prints the length of the longest path
     8 This utility just prints the length of the longest path
     9 in the revision graph from revison 0 to the current one.
     9 in the revision graph from revison 0 to the current one.
    10 """
    10 """
    11     exit(0)
    11     exit(0)
    12 plist = os.popen("hg parents --template='{rev}\n'").readlines()
    12 plist = os.popen("HGRCPATH='' hg parents --template='{rev}\n'").readlines()
    13 if len(plist)>1:
    13 if len(plist)>1:
    14     print "You are in the process of merging"
    14     print "You are in the process of merging"
    15     exit(1)
    15     exit(1)
    16 PAR = int(plist[0])
    16 PAR = int(plist[0])
    17 
    17 
    18 f = os.popen("hg log -r 0:tip --template='{rev} {parents}\n'").readlines()
    18 f = os.popen("HGRCPATH='' hg log -r 0:tip --template='{rev} {parents}\n'").\
       
    19     readlines()
    19 REV = -1
    20 REV = -1
    20 lengths=[]
    21 lengths=[]
    21 for l in f:
    22 for l in f:
    22     REV+=1
    23     REV+=1
    23     s = l.split()
    24     s = l.split()