diff options
author | Felipe Contreras <felipe.contreras@gmail.com> | 2013-05-14 08:20:27 +0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-05-15 02:51:00 +0400 |
commit | 6a3ac18ba3150a7e089c0c6b6648b364c71f87c9 (patch) | |
tree | ad46f9495b6d6bc9ac0ec28c88128fa4c80227cf /contrib/remote-helpers/git-remote-bzr | |
parent | ab84621754e9c6f05279b42e51b445baac28a8ea (diff) |
remote-bzr: update old organization
If a clone exists with the old organization (v1.8.2) it will prevent
the new shared bzr repository organization from working, so let's
remove this repository, which is not used any more.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib/remote-helpers/git-remote-bzr')
-rwxr-xr-x | contrib/remote-helpers/git-remote-bzr | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/contrib/remote-helpers/git-remote-bzr b/contrib/remote-helpers/git-remote-bzr index 3e452af1dc..b295dd4895 100755 --- a/contrib/remote-helpers/git-remote-bzr +++ b/contrib/remote-helpers/git-remote-bzr @@ -830,6 +830,13 @@ def get_repo(url, alias): clone_path = os.path.join(dirname, 'clone') if not os.path.exists(clone_path): os.mkdir(clone_path) + else: + # check and remove old organization + try: + bdir = bzrlib.bzrdir.BzrDir.open(clone_path) + bdir.destroy_repository() + except bzrlib.errors.NotBranchError: + pass try: repo = origin.open_repository() |