Mercurial > hg > mercurial-crew-with-dirclash
comparison mercurial/hg.py @ 3105:ef4e5d05bac4
Merge with mainline
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Sun, 17 Sep 2006 16:02:09 -0500 |
parents | bc3fe3b5b785 |
children | 705e30c0a230 |
comparison
equal
deleted
inserted
replaced
3104:e6818b0b8154 | 3105:ef4e5d05bac4 |
---|---|
113 | 113 |
114 dest = localpath(dest) | 114 dest = localpath(dest) |
115 source = localpath(source) | 115 source = localpath(source) |
116 | 116 |
117 if os.path.exists(dest): | 117 if os.path.exists(dest): |
118 raise util.Abort(_("destination '%s' already exists"), dest) | 118 raise util.Abort(_("destination '%s' already exists") % dest) |
119 | 119 |
120 class DirCleanup(object): | 120 class DirCleanup(object): |
121 def __init__(self, dir_): | 121 def __init__(self, dir_): |
122 self.rmtree = shutil.rmtree | 122 self.rmtree = shutil.rmtree |
123 self.dir_ = dir_ | 123 self.dir_ = dir_ |
125 self.dir_ = None | 125 self.dir_ = None |
126 def __del__(self): | 126 def __del__(self): |
127 if self.dir_: | 127 if self.dir_: |
128 self.rmtree(self.dir_, True) | 128 self.rmtree(self.dir_, True) |
129 | 129 |
130 dest_repo = None | 130 dest_repo = repository(ui, dest, create=True) |
131 try: | |
132 dest_repo = repository(ui, dest) | |
133 raise util.Abort(_("destination '%s' already exists." % dest)) | |
134 except RepoError: | |
135 dest_repo = repository(ui, dest, create=True) | |
136 | 131 |
137 dest_path = None | 132 dest_path = None |
138 dir_cleanup = None | 133 dir_cleanup = None |
139 if dest_repo.local(): | 134 if dest_repo.local(): |
140 dest_path = os.path.realpath(dest_repo.root) | 135 dest_path = os.path.realpath(dest_repo.root) |