##// END OF EJS Templates
commands: lock() the repo while unbundling (issue1004)
Patrick Mezard -
r6180:d98ef038 default
parent child Browse files
Show More
@@ -2649,6 +2649,10 b' def unbundle(ui, repo, fname1, *fnames, '
2649 bundle command.
2649 bundle command.
2650 """
2650 """
2651 fnames = (fname1,) + fnames
2651 fnames = (fname1,) + fnames
2652
2653 lock = None
2654 try:
2655 lock = repo.lock()
2652 for fname in fnames:
2656 for fname in fnames:
2653 if os.path.exists(fname):
2657 if os.path.exists(fname):
2654 f = open(fname, "rb")
2658 f = open(fname, "rb")
@@ -2656,6 +2660,8 b' def unbundle(ui, repo, fname1, *fnames, '
2656 f = urllib.urlopen(fname)
2660 f = urllib.urlopen(fname)
2657 gen = changegroup.readbundle(f, fname)
2661 gen = changegroup.readbundle(f, fname)
2658 modheads = repo.addchangegroup(gen, 'unbundle', 'bundle:' + 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