tests/test-filelog
changeset 15876 2de1244361aa
parent 11540 2370e270a29a
equal deleted inserted replaced
15875:7eca9db689d6 15876:2de1244361aa
    15         # data doesnt matter. Just make sure filelog.renamed() returns True
    15         # data doesnt matter. Just make sure filelog.renamed() returns True
    16         meta = dict(copyrev=hex(nullid), copy='bar')
    16         meta = dict(copyrev=hex(nullid), copy='bar')
    17     else:
    17     else:
    18         meta = {}
    18         meta = {}
    19 
    19 
    20     t = repo.transaction('commit')
    20     lock = t = None
    21     try:
    21     try:
       
    22         lock = repo.lock()
       
    23         t = repo.transaction('commit')
    22         node = fl.add(text, meta, t, 0, nullid, nullid)
    24         node = fl.add(text, meta, t, 0, nullid, nullid)
    23         return node
    25         return node
    24     finally:
    26     finally:
    25         t.close()
    27         if t:
       
    28             t.close()
       
    29         if lock:
       
    30             lock.release()
    26 
    31 
    27 def error(text):
    32 def error(text):
    28     print 'ERROR: ' + text
    33     print 'ERROR: ' + text
    29 
    34 
    30 textwith = '\1\nfoo'
    35 textwith = '\1\nfoo'