remote-hg: fix 'shared path' path
authorFelipe Contreras <felipe.contreras@gmail.com>
Sat, 7 Dec 2013 13:09:42 +0000 (07:09 -0600)
committerJunio C Hamano <gitster@pobox.com>
Mon, 9 Dec 2013 21:18:44 +0000 (13:18 -0800)
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>
contrib/remote-helpers/git-remote-hg
index 852fdcf517beff751378dcf158545428bb07b5e5..eb89ef67798e70fd77eff341e3dda5385d3cde48 100755 (executable)
@@ -415,6 +415,9 @@ def get_repo(url, alias):
         local_path = os.path.join(dirname, 'clone')
         if not os.path.exists(local_path):
             hg.share(myui, shared_path, local_path, update=False)
         local_path = os.path.join(dirname, 'clone')
         if not os.path.exists(local_path):
             hg.share(myui, shared_path, local_path, update=False)
+        else:
+            # make sure the shared path is always up-to-date
+            util.writefile(os.path.join(local_path, '.hg', 'sharedpath'), hg_path)
 
         repo = hg.repository(myui, local_path)
         try:
 
         repo = hg.repository(myui, local_path)
         try: