Skip to content

Commit

Permalink
remote-hg: fix 'shared path' path
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Felipe Contreras authored and Junio C Hamano committed Dec 9, 2013
1 parent 0c0ebc1 commit e71d137
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions contrib/remote-helpers/git-remote-hg
Original file line number Diff line number Diff line change
Expand Up @@ -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)
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:
Expand Down

0 comments on commit e71d137

Please sign in to comment.