share: fix source repo lookup on Windows
authorMatt Harbison <matt_harbison@yahoo.com>
Thu, 18 Dec 2014 23:16:37 -0500
changeset 23625 3a8a85469ee8
parent 23624 861ddedfb402
child 23626 012a7b482d68
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.
hgext/share.py
--- a/hgext/share.py	Mon Dec 22 03:20:50 2014 +0100
+++ b/hgext/share.py	Thu Dec 18 23:16:37 2014 -0500
@@ -96,7 +96,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: