comparison mercurial/commands.py @ 1754:fdfe89a3962d

use repo.lock when cloning via copy, use lock.LockException when necessary
author Benoit Boissinot <benoit.boissinot@ens-lyon.org>
date Mon, 20 Feb 2006 01:12:03 +0100
parents d457fec76ab0
children a8f7791e3680
comparison
equal deleted inserted replaced
1753:e6e70450edb9 1754:fdfe89a3962d
722 try: 722 try:
723 # we use a lock here because if we race with commit, we 723 # we use a lock here because if we race with commit, we
724 # can end up with extra data in the cloned revlogs that's 724 # can end up with extra data in the cloned revlogs that's
725 # not pointed to by changesets, thus causing verify to 725 # not pointed to by changesets, thus causing verify to
726 # fail 726 # fail
727 l1 = lock.lock(os.path.join(source, ".hg", "lock")) 727 l1 = other.lock()
728 except OSError: 728 except lock.LockException:
729 copy = False 729 copy = False
730 730
731 if copy: 731 if copy:
732 # we lock here to avoid premature writing to the target 732 # we lock here to avoid premature writing to the target
733 os.mkdir(os.path.join(dest, ".hg")) 733 os.mkdir(os.path.join(dest, ".hg"))