Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/commands.py @ 6180:d98ef03893e6
commands: lock() the repo while unbundling (issue1004)
author | Patrick Mezard <pmezard@gmail.com> |
---|---|
date | Thu, 28 Feb 2008 00:07:38 +0100 |
parents | 81afdd016867 |
children | 07f2236c4dee |
comparison
equal
deleted
inserted
replaced
6179:36ab165abbe2 | 6180:d98ef03893e6 |
---|---|
2647 | 2647 |
2648 Apply one or more compressed changegroup files generated by the | 2648 Apply one or more compressed changegroup files generated by the |
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 |
2662 def update(ui, repo, node=None, rev=None, clean=False, date=None): | 2668 def update(ui, repo, node=None, rev=None, clean=False, date=None): |
2663 """update working directory | 2669 """update working directory |