Show More
@@ -2524,6 +2524,7 b' def _dograft(ui, repo, *revs, **opts):' | |||||
2524 | revs.remove(ids[n]) |
|
2524 | revs.remove(ids[n]) | |
2525 | elif ctx.hex() in ids: |
|
2525 | elif ctx.hex() in ids: | |
2526 | r = ids[ctx.hex()] |
|
2526 | r = ids[ctx.hex()] | |
|
2527 | if r in revs: | |||
2527 | ui.warn(_('skipping already grafted revision %d:%s ' |
|
2528 | ui.warn(_('skipping already grafted revision %d:%s ' | |
2528 | '(was grafted from %d:%s)\n') % |
|
2529 | '(was grafted from %d:%s)\n') % | |
2529 | (r, repo[r], rev, ctx)) |
|
2530 | (r, repo[r], rev, ctx)) |
@@ -181,7 +181,22 b' def checkexec(path):' | |||||
181 |
|
181 | |||
182 | try: |
|
182 | try: | |
183 | EXECFLAGS = stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH |
|
183 | EXECFLAGS = stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH | |
184 |
|
|
184 | basedir = os.path.join(path, '.hg') | |
|
185 | cachedir = os.path.join(basedir, 'cache') | |||
|
186 | storedir = os.path.join(basedir, 'store') | |||
|
187 | if not os.path.exists(cachedir): | |||
|
188 | try: | |||
|
189 | # we want to create the 'cache' directory, not the '.hg' one. | |||
|
190 | # Automatically creating '.hg' directory could silently spawn | |||
|
191 | # invalid Mercurial repositories. That seems like a bad idea. | |||
|
192 | os.mkdir(cachedir) | |||
|
193 | if os.path.exists(storedir): | |||
|
194 | copymode(storedir, cachedir) | |||
|
195 | else: | |||
|
196 | copymode(basedir, cachedir) | |||
|
197 | except (IOError, OSError): | |||
|
198 | # we other fallback logic triggers | |||
|
199 | pass | |||
185 | if os.path.isdir(cachedir): |
|
200 | if os.path.isdir(cachedir): | |
186 | checkisexec = os.path.join(cachedir, 'checkisexec') |
|
201 | checkisexec = os.path.join(cachedir, 'checkisexec') | |
187 | checknoexec = os.path.join(cachedir, 'checknoexec') |
|
202 | checknoexec = os.path.join(cachedir, 'checknoexec') |
@@ -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 |
|
|
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 |
|
|
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, |
|
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) |
@@ -88,6 +88,9 b' Non store repo:' | |||||
88 | .hg/00manifest.i |
|
88 | .hg/00manifest.i | |
89 | .hg/cache |
|
89 | .hg/cache | |
90 | .hg/cache/branch2-served |
|
90 | .hg/cache/branch2-served | |
|
91 | .hg/cache/checkisexec (execbit !) | |||
|
92 | .hg/cache/checklink (symlink !) | |||
|
93 | .hg/cache/checklink-target (symlink !) | |||
91 | .hg/cache/manifestfulltextcache (reporevlogstore !) |
|
94 | .hg/cache/manifestfulltextcache (reporevlogstore !) | |
92 | .hg/cache/rbc-names-v1 |
|
95 | .hg/cache/rbc-names-v1 | |
93 | .hg/cache/rbc-revs-v1 |
|
96 | .hg/cache/rbc-revs-v1 | |
@@ -122,6 +125,9 b' Non fncache repo:' | |||||
122 | .hg/00changelog.i |
|
125 | .hg/00changelog.i | |
123 | .hg/cache |
|
126 | .hg/cache | |
124 | .hg/cache/branch2-served |
|
127 | .hg/cache/branch2-served | |
|
128 | .hg/cache/checkisexec (execbit !) | |||
|
129 | .hg/cache/checklink (symlink !) | |||
|
130 | .hg/cache/checklink-target (symlink !) | |||
125 | .hg/cache/manifestfulltextcache (reporevlogstore !) |
|
131 | .hg/cache/manifestfulltextcache (reporevlogstore !) | |
126 | .hg/cache/rbc-names-v1 |
|
132 | .hg/cache/rbc-names-v1 | |
127 | .hg/cache/rbc-revs-v1 |
|
133 | .hg/cache/rbc-revs-v1 |
@@ -1422,6 +1422,52 b' also detecting that both 3 and 5 should ' | |||||
1422 |
|
1422 | |||
1423 | $ cd .. |
|
1423 | $ cd .. | |
1424 |
|
1424 | |||
|
1425 | Grafted revision should be warned and skipped only once. (issue6024) | |||
|
1426 | ||||
|
1427 | $ mkdir issue6024 | |||
|
1428 | $ cd issue6024 | |||
|
1429 | ||||
|
1430 | $ hg init base | |||
|
1431 | $ cd base | |||
|
1432 | $ touch x | |||
|
1433 | $ hg commit -qAminit | |||
|
1434 | $ echo a > x | |||
|
1435 | $ hg commit -mchange | |||
|
1436 | $ hg update -q 0 | |||
|
1437 | $ hg graft -r 1 | |||
|
1438 | grafting 1:a0b923c546aa "change" (tip) | |||
|
1439 | $ cd .. | |||
|
1440 | ||||
|
1441 | $ hg clone -qr 2 base clone | |||
|
1442 | $ cd clone | |||
|
1443 | $ hg pull -q | |||
|
1444 | $ hg merge -q 2 | |||
|
1445 | $ hg commit -mmerge | |||
|
1446 | $ hg update -q 0 | |||
|
1447 | $ hg graft -r 1 | |||
|
1448 | grafting 1:04fc6d444368 "change" | |||
|
1449 | $ hg update -q 3 | |||
|
1450 | $ hg log -G -T '{rev}:{node|shortest} <- {extras.source|shortest}\n' | |||
|
1451 | o 4:4e16 <- a0b9 | |||
|
1452 | | | |||
|
1453 | | @ 3:f0ac <- | |||
|
1454 | | |\ | |||
|
1455 | +---o 2:a0b9 <- | |||
|
1456 | | | | |||
|
1457 | | o 1:04fc <- a0b9 | |||
|
1458 | |/ | |||
|
1459 | o 0:7848 <- | |||
|
1460 | ||||
|
1461 | ||||
|
1462 | the source of rev 4 is an ancestor of the working parent, and was also | |||
|
1463 | grafted as rev 1. it should be stripped from the target revisions only once. | |||
|
1464 | ||||
|
1465 | $ hg graft -r 4 | |||
|
1466 | skipping already grafted revision 4:4e16bab40c9c (1:04fc6d444368 also has origin 2:a0b923c546aa) | |||
|
1467 | [255] | |||
|
1468 | ||||
|
1469 | $ cd ../.. | |||
|
1470 | ||||
1425 | Testing the reading of old format graftstate file with newer mercurial |
|
1471 | Testing the reading of old format graftstate file with newer mercurial | |
1426 |
|
1472 | |||
1427 | $ hg init oldgraft |
|
1473 | $ hg init oldgraft |
@@ -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 |
@@ -69,6 +69,9 b' new directories are setgid' | |||||
69 | 00600 ./.hg/00changelog.i |
|
69 | 00600 ./.hg/00changelog.i | |
70 | 00770 ./.hg/cache/ |
|
70 | 00770 ./.hg/cache/ | |
71 | 00660 ./.hg/cache/branch2-served |
|
71 | 00660 ./.hg/cache/branch2-served | |
|
72 | 00711 ./.hg/cache/checkisexec | |||
|
73 | 00777 ./.hg/cache/checklink | |||
|
74 | 00600 ./.hg/cache/checklink-target | |||
72 | 00660 ./.hg/cache/manifestfulltextcache (reporevlogstore !) |
|
75 | 00660 ./.hg/cache/manifestfulltextcache (reporevlogstore !) | |
73 | 00660 ./.hg/cache/rbc-names-v1 |
|
76 | 00660 ./.hg/cache/rbc-names-v1 | |
74 | 00660 ./.hg/cache/rbc-revs-v1 |
|
77 | 00660 ./.hg/cache/rbc-revs-v1 |
@@ -22,16 +22,22 b" share shouldn't have a store dir" | |||||
22 | $ test -d .hg/store |
|
22 | $ test -d .hg/store | |
23 | [1] |
|
23 | [1] | |
24 |
|
24 | |||
25 | share shouldn't have a cache dir, original repo should |
|
25 | share shouldn't have a full cache dir, original repo should | |
26 |
|
26 | |||
27 | $ hg branches |
|
27 | $ hg branches | |
28 | default 0:d3873e73d99e |
|
28 | default 0:d3873e73d99e | |
29 | $ hg tags |
|
29 | $ hg tags | |
30 | tip 0:d3873e73d99e |
|
30 | tip 0:d3873e73d99e | |
31 |
$ |
|
31 | $ ls -1 .hg/cache || true | |
32 | [1] |
|
32 | ls: .hg/cache: $ENOENT$ (no-execbit no-symlink !) | |
|
33 | checkisexec (execbit !) | |||
|
34 | checklink (symlink !) | |||
|
35 | checklink-target (symlink !) | |||
33 |
$ |
|
36 | $ ls -1 ../repo1/.hg/cache | |
34 | branch2-served |
|
37 | branch2-served | |
|
38 | checkisexec (execbit !) | |||
|
39 | checklink (symlink !) | |||
|
40 | checklink-target (symlink !) | |||
35 | manifestfulltextcache (reporevlogstore !) |
|
41 | manifestfulltextcache (reporevlogstore !) | |
36 | rbc-names-v1 |
|
42 | rbc-names-v1 | |
37 | rbc-revs-v1 |
|
43 | rbc-revs-v1 |
@@ -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 |
@@ -574,6 +574,7 b' whereas clone should fail.' | |||||
574 |
|
574 | |||
575 | $ hg --config progress.disable=True clone ../empty2 ../empty_clone |
|
575 | $ hg --config progress.disable=True clone ../empty2 ../empty_clone | |
576 | updating to branch default |
|
576 | updating to branch default | |
|
577 | cloning subrepo foo from $TESTTMP/empty2/foo | |||
577 | abort: repository $TESTTMP/empty2/foo not found! |
|
578 | abort: repository $TESTTMP/empty2/foo not found! | |
578 | [255] |
|
579 | [255] | |
579 |
|
580 |
@@ -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