##// END OF EJS Templates
don't use localrepo.__init__ to create the dest repo with clone+hardlinks
Benoit Boissinot -
r3849:972d14a5 default
parent child Browse files
Show More
@@ -127,15 +127,13 def clone(ui, source, dest=None, pull=Fa
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 = repository(ui, dest, create=True)
131
132 dir_cleanup = None
130 dir_cleanup = None
133 if dest_repo.local():
131 if islocal(dest):
134 dir_cleanup = DirCleanup(os.path.realpath(dest_repo.root))
132 dir_cleanup = DirCleanup(dest)
135
133
136 abspath = source
134 abspath = source
137 copy = False
135 copy = False
138 if src_repo.local() and dest_repo.local():
136 if src_repo.local() and islocal(dest):
139 abspath = os.path.abspath(source)
137 abspath = os.path.abspath(source)
140 copy = not pull and not rev
138 copy = not pull and not rev
141
139
@@ -153,7 +151,11 def clone(ui, source, dest=None, pull=Fa
153 if copy:
151 if copy:
154 # we lock here to avoid premature writing to the target
152 # we lock here to avoid premature writing to the target
155 src_store = os.path.realpath(src_repo.spath)
153 src_store = os.path.realpath(src_repo.spath)
156 dest_store = os.path.realpath(dest_repo.spath)
154 dest_path = os.path.realpath(os.path.join(dest, ".hg"))
155 dest_store = dest_path
156 if not os.path.exists(dest):
157 os.mkdir(dest)
158 os.mkdir(dest_path)
157 dest_lock = lock.lock(os.path.join(dest_store, "lock"))
159 dest_lock = lock.lock(os.path.join(dest_store, "lock"))
158
160
159 files = ("data",
161 files = ("data",
@@ -173,6 +175,8 def clone(ui, source, dest=None, pull=Fa
173 dest_repo = repository(ui, dest)
175 dest_repo = repository(ui, dest)
174
176
175 else:
177 else:
178 dest_repo = repository(ui, dest, create=True)
179
176 revs = None
180 revs = None
177 if rev:
181 if rev:
178 if 'lookup' not in src_repo.capabilities:
182 if 'lookup' not in src_repo.capabilities:
General Comments 0
You need to be logged in to leave comments. Login now