##// END OF EJS Templates
subrepo: print the status line before creating the peer for better diagnostics...
Matt Harbison -
r40691:69d4c8c5 stable
parent child Browse files
Show More
@@ -622,7 +622,11 b' class hgsubrepo(abstractsubrepo):'
622 return True
622 return True
623 self._repo._subsource = source
623 self._repo._subsource = source
624 srcurl = _abssource(self._repo)
624 srcurl = _abssource(self._repo)
625 other = hg.peer(self._repo, {}, srcurl)
625
626 # Defer creating the peer until after the status message is logged, in
627 # case there are network problems.
628 getpeer = lambda: hg.peer(self._repo, {}, srcurl)
629
626 if len(self._repo) == 0:
630 if len(self._repo) == 0:
627 # use self._repo.vfs instead of self.wvfs to remove .hg only
631 # use self._repo.vfs instead of self.wvfs to remove .hg only
628 self._repo.vfs.rmtree()
632 self._repo.vfs.rmtree()
@@ -636,7 +640,7 b' class hgsubrepo(abstractsubrepo):'
636 self.ui.status(_('sharing subrepo %s from %s\n')
640 self.ui.status(_('sharing subrepo %s from %s\n')
637 % (subrelpath(self), srcurl))
641 % (subrelpath(self), srcurl))
638 shared = hg.share(self._repo._subparent.baseui,
642 shared = hg.share(self._repo._subparent.baseui,
639 other, self._repo.root,
643 getpeer(), self._repo.root,
640 update=False, bookmarks=False)
644 update=False, bookmarks=False)
641 self._repo = shared.local()
645 self._repo = shared.local()
642 else:
646 else:
@@ -657,7 +661,7 b' class hgsubrepo(abstractsubrepo):'
657 self.ui.status(_('cloning subrepo %s from %s\n')
661 self.ui.status(_('cloning subrepo %s from %s\n')
658 % (subrelpath(self), util.hidepassword(srcurl)))
662 % (subrelpath(self), util.hidepassword(srcurl)))
659 other, cloned = hg.clone(self._repo._subparent.baseui, {},
663 other, cloned = hg.clone(self._repo._subparent.baseui, {},
660 other, self._repo.root,
664 getpeer(), self._repo.root,
661 update=False, shareopts=shareopts)
665 update=False, shareopts=shareopts)
662 self._repo = cloned.local()
666 self._repo = cloned.local()
663 self._initrepo(parentrepo, source, create=True)
667 self._initrepo(parentrepo, source, create=True)
@@ -666,7 +670,7 b' class hgsubrepo(abstractsubrepo):'
666 self.ui.status(_('pulling subrepo %s from %s\n')
670 self.ui.status(_('pulling subrepo %s from %s\n')
667 % (subrelpath(self), util.hidepassword(srcurl)))
671 % (subrelpath(self), util.hidepassword(srcurl)))
668 cleansub = self.storeclean(srcurl)
672 cleansub = self.storeclean(srcurl)
669 exchange.pull(self._repo, other)
673 exchange.pull(self._repo, getpeer())
670 if cleansub:
674 if cleansub:
671 # keep the repo clean after pull
675 # keep the repo clean after pull
672 self._cachestorehash(srcurl)
676 self._cachestorehash(srcurl)
@@ -340,6 +340,7 b' clone of serve with repo in root and uns'
340 added 3 changesets with 7 changes to 7 files
340 added 3 changesets with 7 changes to 7 files
341 new changesets 8b6053c928fe:56f9bc90cce6
341 new changesets 8b6053c928fe:56f9bc90cce6
342 updating to branch default
342 updating to branch default
343 cloning subrepo sub from http://localhost:$HGPORT/sub
343 abort: HTTP Error 404: Not Found
344 abort: HTTP Error 404: Not Found
344 [255]
345 [255]
345 $ hg clone http://localhost:$HGPORT/ slash-clone
346 $ hg clone http://localhost:$HGPORT/ slash-clone
@@ -350,6 +351,7 b' clone of serve with repo in root and uns'
350 added 3 changesets with 7 changes to 7 files
351 added 3 changesets with 7 changes to 7 files
351 new changesets 8b6053c928fe:56f9bc90cce6
352 new changesets 8b6053c928fe:56f9bc90cce6
352 updating to branch default
353 updating to branch default
354 cloning subrepo sub from http://localhost:$HGPORT/sub
353 abort: HTTP Error 404: Not Found
355 abort: HTTP Error 404: Not Found
354 [255]
356 [255]
355
357
@@ -417,6 +417,7 b' clone of serve with repo in root and uns'
417 added 3 changesets with 7 changes to 7 files
417 added 3 changesets with 7 changes to 7 files
418 new changesets 8b6053c928fe:56f9bc90cce6
418 new changesets 8b6053c928fe:56f9bc90cce6
419 updating to branch default
419 updating to branch default
420 cloning subrepo sub from http://localhost:$HGPORT/sub
420 abort: HTTP Error 404: Not Found
421 abort: HTTP Error 404: Not Found
421 [255]
422 [255]
422 $ hg clone http://localhost:$HGPORT/ slash-clone
423 $ hg clone http://localhost:$HGPORT/ slash-clone
@@ -427,6 +428,7 b' clone of serve with repo in root and uns'
427 added 3 changesets with 7 changes to 7 files
428 added 3 changesets with 7 changes to 7 files
428 new changesets 8b6053c928fe:56f9bc90cce6
429 new changesets 8b6053c928fe:56f9bc90cce6
429 updating to branch default
430 updating to branch default
431 cloning subrepo sub from http://localhost:$HGPORT/sub
430 abort: HTTP Error 404: Not Found
432 abort: HTTP Error 404: Not Found
431 [255]
433 [255]
432
434
@@ -108,6 +108,7 b" are also available as siblings of 'main'"
108 added 1 changesets with 3 changes to 3 files
108 added 1 changesets with 3 changes to 3 files
109 new changesets 7f491f53a367
109 new changesets 7f491f53a367
110 updating to branch default
110 updating to branch default
111 cloning subrepo sub1 from http://localhost:$HGPORT/../sub1
111 abort: HTTP Error 404: Not Found
112 abort: HTTP Error 404: Not Found
112 [255]
113 [255]
113
114
@@ -567,11 +567,13 b' updated from null), fails the same as a '
567 $ hg --config extensions.share= --config progress.disable=True \
567 $ hg --config extensions.share= --config progress.disable=True \
568 > share ../empty2 ../empty_share
568 > share ../empty2 ../empty_share
569 updating working directory
569 updating working directory
570 sharing subrepo foo from $TESTTMP/empty2/foo
570 abort: repository $TESTTMP/empty2/foo not found!
571 abort: repository $TESTTMP/empty2/foo not found!
571 [255]
572 [255]
572
573
573 $ hg --config progress.disable=True clone ../empty2 ../empty_clone
574 $ hg --config progress.disable=True clone ../empty2 ../empty_clone
574 updating to branch default
575 updating to branch default
576 cloning subrepo foo from $TESTTMP/empty2/foo
575 abort: repository $TESTTMP/empty2/foo not found!
577 abort: repository $TESTTMP/empty2/foo not found!
576 [255]
578 [255]
577
579
@@ -1889,6 +1889,7 b' test for ssh exploit 2017-07-25'
1889 $ cd ..
1889 $ cd ..
1890 $ hg clone malicious-proxycommand malicious-proxycommand-clone
1890 $ hg clone malicious-proxycommand malicious-proxycommand-clone
1891 updating to branch default
1891 updating to branch default
1892 cloning subrepo s from ssh://-oProxyCommand%3Dtouch%24%7BIFS%7Downed/path
1892 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch${IFS}owned/path' (in subrepository "s")
1893 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch${IFS}owned/path' (in subrepository "s")
1893 [255]
1894 [255]
1894
1895
@@ -1901,6 +1902,7 b" also check that a percent encoded '-' (%"
1901 $ rm -r malicious-proxycommand-clone
1902 $ rm -r malicious-proxycommand-clone
1902 $ hg clone malicious-proxycommand malicious-proxycommand-clone
1903 $ hg clone malicious-proxycommand malicious-proxycommand-clone
1903 updating to branch default
1904 updating to branch default
1905 cloning subrepo s from ssh://-oProxyCommand%3Dtouch%24%7BIFS%7Downed/path
1904 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch${IFS}owned/path' (in subrepository "s")
1906 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch${IFS}owned/path' (in subrepository "s")
1905 [255]
1907 [255]
1906
1908
@@ -1913,6 +1915,7 b' also check for a pipe'
1913 $ rm -r malicious-proxycommand-clone
1915 $ rm -r malicious-proxycommand-clone
1914 $ hg clone malicious-proxycommand malicious-proxycommand-clone
1916 $ hg clone malicious-proxycommand malicious-proxycommand-clone
1915 updating to branch default
1917 updating to branch default
1918 cloning subrepo s from ssh://fakehost%7Ctouch%24%7BIFS%7Downed/path
1916 abort: no suitable response from remote hg!
1919 abort: no suitable response from remote hg!
1917 [255]
1920 [255]
1918 $ [ ! -f owned ] || echo 'you got owned'
1921 $ [ ! -f owned ] || echo 'you got owned'
@@ -1926,6 +1929,7 b" also check that a percent encoded '|' (%"
1926 $ rm -r malicious-proxycommand-clone
1929 $ rm -r malicious-proxycommand-clone
1927 $ hg clone malicious-proxycommand malicious-proxycommand-clone
1930 $ hg clone malicious-proxycommand malicious-proxycommand-clone
1928 updating to branch default
1931 updating to branch default
1932 cloning subrepo s from ssh://fakehost%7Ctouch%20owned/path
1929 abort: no suitable response from remote hg!
1933 abort: no suitable response from remote hg!
1930 [255]
1934 [255]
1931 $ [ ! -f owned ] || echo 'you got owned'
1935 $ [ ! -f owned ] || echo 'you got owned'
@@ -1938,6 +1942,7 b' and bad usernames:'
1938 $ rm -r malicious-proxycommand-clone
1942 $ rm -r malicious-proxycommand-clone
1939 $ hg clone malicious-proxycommand malicious-proxycommand-clone
1943 $ hg clone malicious-proxycommand malicious-proxycommand-clone
1940 updating to branch default
1944 updating to branch default
1945 cloning subrepo s from ssh://-oProxyCommand%3Dtouch%20owned@example.com/path
1941 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch owned@example.com/path' (in subrepository "s")
1946 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch owned@example.com/path' (in subrepository "s")
1942 [255]
1947 [255]
1943
1948
General Comments 0
You need to be logged in to leave comments. Login now