remote-hg: fix 'shared path' path
If the repository is moved, the absolute path of the shared repository would fail. Make sure it's always up-to-date. Reported-by: Michael Davis <mjmdavis@gmail.com> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Felipe Contreras committed
Dec 7, 2013 at 07:09 UTC
e71d13787929d4a043cb3906cfa4afa69e5fd0db
1 file changed
+3
contrib/remote-helpers/git-remote-hg
+3
@@ -415,6 +415,9 @@ def get_repo(url, alias):
415
local_path = os.path.join(dirname, 'clone')
416
if not os.path.exists(local_path):
417
hg.share(myui, shared_path, local_path, update=False)
418
+ else:
419
+ # make sure the shared path is always up-to-date
420
+ util.writefile(os.path.join(local_path, '.hg', 'sharedpath'), hg_path)
421
422
repo = hg.repository(myui, local_path)
423
try: