diff --git a/mercurial/statichttprepo.py b/mercurial/statichttprepo.py --- a/mercurial/statichttprepo.py +++ b/mercurial/statichttprepo.py @@ -33,7 +33,7 @@ class statichttprepository(localrepo.loc self._url = path self.ui = ui - self.path = (path + "/.hg") + self.path = path.rstrip('/') + "/.hg" self.opener = opener(self.path) # find requirements try: diff --git a/tests/test-static-http b/tests/test-static-http --- a/tests/test-static-http +++ b/tests/test-static-http @@ -49,4 +49,18 @@ echo '[hooks]' >> .hg/hgrc echo 'changegroup = python ../printenv.py changegroup' >> .hg/hgrc http_proxy= hg pull +echo '% test with "/" URI (issue 747)' +cd .. +hg init +echo a > a +hg add a +hg ci -ma + +http_proxy= hg clone static-http://localhost:20059/ local2 + +cd local2 +hg verify +cat a +hg paths + kill $! diff --git a/tests/test-static-http.out b/tests/test-static-http.out --- a/tests/test-static-http.out +++ b/tests/test-static-http.out @@ -28,3 +28,17 @@ adding manifests adding file changes added 1 changesets with 1 changes to 1 files (run 'hg update' to get a working copy) +% test with "/" URI (issue 747) +requesting all changes +adding changesets +adding manifests +adding file changes +added 1 changesets with 1 changes to 1 files +1 files updated, 0 files merged, 0 files removed, 0 files unresolved +checking changesets +checking manifests +crosschecking files in changesets and manifests +checking files +1 files, 1 changesets, 1 total revisions +a +default = static-http://localhost:20059/