[PATCH 1 of 3] share: fix source repo lookup on Windows

Matt Harbison mharbison72 at gmail.com
Fri Dec 19 05:19:53 UTC 2014


# HG changeset patch
# User Matt Harbison <matt_harbison at yahoo.com>
# Date 1418962597 18000
#      Thu Dec 18 23:16:37 2014 -0500
# Node ID 2e2ea8cb73c5a1861c8b249eaf74336513bba263
# Parent  a4679a74df144213aa2e6b6d86cf6d02eb193c10
share: fix source repo lookup on Windows

The stored path contains platform specific separators, so splitting on '/.hg'
returned the string unmodified on Windows.  The source was then looked for in
$source/.hg/.hg, which obviously fails.  This caused cascading errors in
test-share.t relating to the recent bookmark support.

diff --git a/hgext/share.py b/hgext/share.py
--- a/hgext/share.py
+++ b/hgext/share.py
@@ -95,7 +95,7 @@
         # strip because some tools write with newline after
         sharedpath = repo.vfs.read('sharedpath').strip()
         # the sharedpath always ends in the .hg; we want the path to the repo
-        source = sharedpath.rsplit('/.hg', 1)[0]
+        source = repo.vfs.split(sharedpath)[0]
         srcurl, branches = parseurl(source)
         srcrepo = repository(repo.ui, srcurl)
     except IOError, inst:


More information about the Mercurial-devel mailing list