##// END OF EJS Templates
commands: lock() the repo while unbundling (issue1004)
Patrick Mezard -
r6180:d98ef038 default
parent child Browse files
Show More
@@ -2649,13 +2649,19 b' def unbundle(ui, repo, fname1, *fnames, '
2649 bundle command.
2649 bundle command.
2650 """
2650 """
2651 fnames = (fname1,) + fnames
2651 fnames = (fname1,) + fnames
2652 for fname in fnames:
2652
2653 if os.path.exists(fname):
2653 lock = None
2654 f = open(fname, "rb")
2654 try:
2655 else:
2655 lock = repo.lock()
2656 f = urllib.urlopen(fname)
2656 for fname in fnames:
2657 gen = changegroup.readbundle(f, fname)
2657 if os.path.exists(fname):
2658 modheads = repo.addchangegroup(gen, 'unbundle', 'bundle:' + fname)
2658 f = open(fname, "rb")
2659 else:
2660 f = urllib.urlopen(fname)
2661 gen = changegroup.readbundle(f, fname)
2662 modheads = repo.addchangegroup(gen, 'unbundle', 'bundle:' + fname)
2663 finally:
2664 del lock
2659
2665
2660 return postincoming(ui, repo, modheads, opts['update'], None)
2666 return postincoming(ui, repo, modheads, opts['update'], None)
2661
2667
General Comments 0
You need to be logged in to leave comments. Login now