Mercurial > hg
changeset 47759:d7515d29761d stable 5.9rc0
branching: merge default into stable
This mark the start of the 5.9 freeze.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Wed, 21 Jul 2021 22:52:09 +0200 |
parents | 29ea3b4c4f62 (diff) ec77f709495c (current diff) |
children | 9e6978463c6e |
files | mercurial/revlog.py mercurial/streamclone.py |
diffstat | 6 files changed, 193 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/.hgsigs Mon Jul 19 23:14:38 2021 +0200 +++ b/.hgsigs Wed Jul 21 22:52:09 2021 +0200 @@ -211,3 +211,4 @@ f67b8946bb1b6cfa8328dbf8d6a9128b69ccdcb4 0 iQJEBAABCAAuFiEEK8zhT1xnJaouqK63ucncgkqlvdUFAmB+71MQHHJhZkBkdXJpbjQyLmNvbQAKCRC5ydyCSqW91Vj+EADBa/tHfgyymKmXXl9DSlzwEhX1DkCE0aRcsbfXujnpOQrDi09pfHvtYEbgJfl6m8JEUOjuRRcxofnIWOC9UJCGC3ZfW5tTcHomCFlqjHhUxGKsvQ1Wcec1IH3mmzhqLnd0X57EgnNC6APwgxNVRmC0q7M7rSlNiE8BkHEUuyCau5FvpgdF31Aqa9IQP95pmmeDwL4ByPR1Nssu2/8N5vbcQm55gdjcggNjBvNEbaFHDS9NlGS8quvCMwRZkr3meDfTeCs9d2MveXXvV8GVOFq+WHMoURVijTjON+HuXB7HLegyhVOcigfbU5zxGY/IAJ/tAYEzBLWSYW6wjsN5uuZP267XhKpd2FT8Cfe9t3OnN1K21ndltlaMSdGyAynuepzVE0IELOCiKlgBZkdnft2XkUt2DDg/TqhOeXmUBzIFVze5KULSgrFvjkx71iV22LUGkIxzIuW5ieBMeZotKHzI+ZXO7xNSDIdoSfERKUqfYJKbksnBQLRxYUO77KetjocsMMYyB4Dpzu05+eWpYtZs2u5PsqP/Jv84Mz3QR0szAI1h3KlhmbkvKxnWnFYasAdFPMluX4G4X+9+MulODCwgw/RvQhh13M2QP0vGb1X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CIRAws1JHEjKYFob7VRMxpivW7GDSd6QrmUbTHYN5eY0v1YB62dCa8W9qk2E7R5VdLRi4haFTv42u7jOZT0tSzRv/R0QppoVQ7/Fpqpps+aoZBM6EGj/pAxRgBTHeyI9WTFUAYDbhRuN9EoJAqRUCpXn39oR+TsaD9COENAJroX2WLIY8XFD3UzrpA9NPt7JE9mufWoNipNqLdLY7k3p3UxX0/SDboVlax6ORpQN+YzYhCesJaAOhlTAXMRMyXsfw/ScYttXxmIJ7BINYEMSXM55uiUPYFjE/GuZjbjgqk3dmJr7ceAyGa5v+m5Hr6efPSRHKUAxkEcDsXpcTHyEOVt3l7Qwfd+oUumK
--- a/.hgtags Mon Jul 19 23:14:38 2021 +0200 +++ b/.hgtags Wed Jul 21 22:52:09 2021 +0200 @@ -224,3 +224,4 @@ f67b8946bb1b6cfa8328dbf8d6a9128b69ccdcb4 5.8rc0 8d2b62d716b095507effaa8d56f87cd27ba659ab 5.8rc1 067f2c53fb24506c9e9fb4639871b13b19a85f8a 5.8 +411dc27fd9fd076d6a031a08fcaace659afe2fe3 5.8.1
--- a/mercurial/revlog.py Mon Jul 19 23:14:38 2021 +0200 +++ b/mercurial/revlog.py Wed Jul 21 22:52:09 2021 +0200 @@ -897,10 +897,8 @@ if rev == wdirrev: raise error.WdirUnsupported raise - if entry[5] == nullrev: - return entry[6], entry[5] - else: - return entry[5], entry[6] + + return entry[5], entry[6] # fast parentrevs(rev) where rev isn't filtered _uncheckedparentrevs = parentrevs @@ -921,11 +919,7 @@ def parents(self, node): i = self.index d = i[self.rev(node)] - # inline node() to avoid function call overhead - if d[5] == self.nullid: - return i[d[6]][7], i[d[5]][7] - else: - return i[d[5]][7], i[d[6]][7] + return i[d[5]][7], i[d[6]][7] # map revisions to nodes inline def chainlen(self, rev): return self._chaininfo(rev)[0]
--- a/mercurial/streamclone.py Mon Jul 19 23:14:38 2021 +0200 +++ b/mercurial/streamclone.py Wed Jul 21 22:52:09 2021 +0200 @@ -565,6 +565,16 @@ def _emit2(repo, entries, totalfilesize): """actually emit the stream bundle""" vfsmap = _makemap(repo) + # we keep repo.vfs out of the on purpose, ther are too many danger there + # (eg: .hg/hgrc), + # + # this assert is duplicated (from _makemap) as author might think this is + # fine, while this is really not fine. + if repo.vfs in vfsmap.values(): + raise error.ProgrammingError( + b'repo.vfs must not be added to vfsmap for security reasons' + ) + progress = repo.ui.makeprogress( _(b'bundle'), total=totalfilesize, unit=_(b'bytes') ) @@ -713,6 +723,15 @@ progress.update(0) vfsmap = _makemap(repo) + # we keep repo.vfs out of the on purpose, ther are too many danger + # there (eg: .hg/hgrc), + # + # this assert is duplicated (from _makemap) as author might think this + # is fine, while this is really not fine. + if repo.vfs in vfsmap.values(): + raise error.ProgrammingError( + b'repo.vfs must not be added to vfsmap for security reasons' + ) with repo.transaction(b'clone'): ctxs = (vfs.backgroundclosing(repo.ui) for vfs in vfsmap.values())
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test-issue6528.t Wed Jul 21 22:52:09 2021 +0200 @@ -0,0 +1,168 @@ +=============================================================== +Test non-regression on the corruption associated with issue6528 +=============================================================== + +Setup +----- + + $ hg init base-repo + $ cd base-repo + + $ cat <<EOF > a.txt + > 1 + > 2 + > 3 + > 4 + > 5 + > 6 + > EOF + + $ hg add a.txt + $ hg commit -m 'c_base_c - create a.txt' + +Modify a.txt + + $ sed -e 's/1/foo/' a.txt > a.tmp; mv a.tmp a.txt + $ hg commit -m 'c_modify_c - modify a.txt' + +Modify and rename a.txt to b.txt + + $ hg up -r "desc('c_base_c')" + 1 files updated, 0 files merged, 0 files removed, 0 files unresolved + $ sed -e 's/6/bar/' a.txt > a.tmp; mv a.tmp a.txt + $ hg mv a.txt b.txt + $ hg commit -m 'c_rename_c - rename and modify a.txt to b.txt' + created new head + +Merge each branch + + $ hg merge -r "desc('c_modify_c')" + merging b.txt and a.txt to b.txt + 0 files updated, 1 files merged, 0 files removed, 0 files unresolved + (branch merge, don't forget to commit) + $ hg commit -m 'c_merge_c: commit merge' + + $ hg debugrevlogindex b.txt + rev linkrev nodeid p1 p2 + 0 2 05b806ebe5ea 000000000000 000000000000 + 1 3 a58b36ad6b65 000000000000 05b806ebe5ea + +Check commit Graph + + $ hg log -G + @ changeset: 3:a1cc2bdca0aa + |\ tag: tip + | | parent: 2:615c6ccefd15 + | | parent: 1:373d507f4667 + | | user: test + | | date: Thu Jan 01 00:00:00 1970 +0000 + | | summary: c_merge_c: commit merge + | | + | o changeset: 2:615c6ccefd15 + | | parent: 0:f5a5a568022f + | | user: test + | | date: Thu Jan 01 00:00:00 1970 +0000 + | | summary: c_rename_c - rename and modify a.txt to b.txt + | | + o | changeset: 1:373d507f4667 + |/ user: test + | date: Thu Jan 01 00:00:00 1970 +0000 + | summary: c_modify_c - modify a.txt + | + o changeset: 0:f5a5a568022f + user: test + date: Thu Jan 01 00:00:00 1970 +0000 + summary: c_base_c - create a.txt + + + $ hg cat -r . b.txt + foo + 2 + 3 + 4 + 5 + bar + $ cat b.txt + foo + 2 + 3 + 4 + 5 + bar + $ cd .. + + +Check the lack of corruption +---------------------------- + + $ hg clone --pull base-repo cloned + requesting all changes + adding changesets + adding manifests + adding file changes + added 4 changesets with 4 changes to 2 files + new changesets f5a5a568022f:a1cc2bdca0aa + updating to branch default + 1 files updated, 0 files merged, 0 files removed, 0 files unresolved + $ cd cloned + $ hg up -r "desc('c_merge_c')" + 0 files updated, 0 files merged, 0 files removed, 0 files unresolved + + +Status is buggy, even with debugrebuilddirstate + + $ hg cat -r . b.txt + foo + 2 + 3 + 4 + 5 + bar + $ cat b.txt + foo + 2 + 3 + 4 + 5 + bar + $ hg status + $ hg debugrebuilddirstate + $ hg status + +the history was altered + +in theory p1/p2 order does not matter but in practice p1 == nullid is used as a +marker that some metadata are present and should be fetched. + + $ hg debugrevlogindex b.txt + rev linkrev nodeid p1 p2 + 0 2 05b806ebe5ea 000000000000 000000000000 + 1 3 a58b36ad6b65 000000000000 05b806ebe5ea + +Check commit Graph + + $ hg log -G + @ changeset: 3:a1cc2bdca0aa + |\ tag: tip + | | parent: 2:615c6ccefd15 + | | parent: 1:373d507f4667 + | | user: test + | | date: Thu Jan 01 00:00:00 1970 +0000 + | | summary: c_merge_c: commit merge + | | + | o changeset: 2:615c6ccefd15 + | | parent: 0:f5a5a568022f + | | user: test + | | date: Thu Jan 01 00:00:00 1970 +0000 + | | summary: c_rename_c - rename and modify a.txt to b.txt + | | + o | changeset: 1:373d507f4667 + |/ user: test + | date: Thu Jan 01 00:00:00 1970 +0000 + | summary: c_modify_c - modify a.txt + | + o changeset: 0:f5a5a568022f + user: test + date: Thu Jan 01 00:00:00 1970 +0000 + summary: c_base_c - create a.txt +
--- a/tests/test-narrow-shallow-merges.t Mon Jul 19 23:14:38 2021 +0200 +++ b/tests/test-narrow-shallow-merges.t Wed Jul 21 22:52:09 2021 +0200 @@ -179,7 +179,7 @@ $ hg log -T '{if(ellipsis,"...")}{node|short} {p1node|short} {p2node|short} {desc}\n' | sort - ...2a20009de83e 3ac1f5779de3 000000000000 outside 10 + ...2a20009de83e 000000000000 3ac1f5779de3 outside 10 ...3ac1f5779de3 bb96a08b062a 465567bdfb2d merge a/b/c/d 9 ...8d874d57adea 7ef88b4dd4fa 000000000000 outside 12 ...b844052e7b3b 000000000000 000000000000 outside 2c