Mercurial > evolve
changeset 5945:6d91fe3ec0a2 mercurial-5.0
test-compat: merge mercurial-5.1 into mercurial-5.0
author | Anton Shestakov <av6@dwimlabs.net> |
---|---|
date | Thu, 27 May 2021 23:58:50 +0800 |
parents | 91207a1c4dfa (current diff) 3d08f1fed704 (diff) |
children | 200df6f9597f 571615c48667 |
files | tests/test-discovery-obshashrange.t tests/test-prev-next.t |
diffstat | 16 files changed, 301 insertions(+), 29 deletions(-) [+] |
line wrap: on
line diff
--- a/.hgtags Sat Apr 24 21:34:57 2021 +0800 +++ b/.hgtags Thu May 27 23:58:50 2021 +0800 @@ -93,3 +93,4 @@ 35b883a4ff5a97973eb9e6f00014e71f14cebe70 10.2.0 eadc1d09f2f567fdae7280aefc8cf4cdc4d78cbc 10.2.0.post1 c0ed8e57463875414d1c06f0428d550c4480d289 10.3.0 +93dc3cb6884259f91d739a1cfe993a01820c729c 10.3.1
--- a/CHANGELOG Sat Apr 24 21:34:57 2021 +0800 +++ b/CHANGELOG Thu May 27 23:58:50 2021 +0800 @@ -1,20 +1,38 @@ Changelog ========= -10.3.1 - in progress +10.3.2 - in progress +-------------------- + + * next: remove duplicated targets when updating from an unstable changeset + * evolve: use "served" repo filter to guess what the server will publish + +topic (0.22.2) + + * topic: don't lose any file changes when changing topic of a merge commit + * topic: announce ext-topics-publish capability in case of SSH and HTTP too + +10.3.1 -- 2021-04-25 -------------------- * cache: fix corruption issue when mixing 32-bit and 64-bit environments + * next: unstable changesets with a different topic are no longer targets for hg next as long as it's invoked without --no-topic flag * next: when some potential targets are unstable, ask user which changeset they want to update to (only mixing stable and unstable when --evolve flag is given, which is the default) + * packaging: default to using Python 3 in Makefile + +topic (0.22.1) + + * compatibility with Mercurial 5.8 + 10.3.0 -- 2021-03-11 -------------------- - * doc: document stack as a substitue for MQ's qseries + * doc: document stack as a substitute for MQ's qseries * doc: document revsets provided by evolve extension * evolve: add a experimental.evolution.in-memory config for running evolve @@ -28,7 +46,7 @@ and `hg status` respectively * rewind: detect and abort on cases when we rewind to changesets that are - precessors / successors of each other + predecessors / successors of each other * rewind: when user gives only some parts of a fold, include the other parts as well, or abort if they are missing from local repo
--- a/debian/changelog Sat Apr 24 21:34:57 2021 +0800 +++ b/debian/changelog Thu May 27 23:58:50 2021 +0800 @@ -1,3 +1,9 @@ +mercurial-evolve (10.3.1-1) unstable; urgency=medium + + * new upstream release + + -- Anton Shestakov <av6@dwimlabs.net> Sun, 25 Apr 2021 14:13:18 +0800 + mercurial-evolve (10.3.0-1) unstable; urgency=medium * new upstream release
--- a/hgext3rd/evolve/__init__.py Sat Apr 24 21:34:57 2021 +0800 +++ b/hgext3rd/evolve/__init__.py Thu May 27 23:58:50 2021 +0800 @@ -861,6 +861,11 @@ if repo[rev].topic() != topic) aspchildren = [rev for rev in aspchildren if rev not in filtered] + # Let's make sure we don't have any duplicates between children and + # aspiring children + filtered.update(ctx.rev() for ctx in children) + aspchildren = [rev for rev in aspchildren if rev not in filtered] + # To catch and prevent the case when `next` would get confused by split, # lets filter those aspiring children which can be stablized on one of # the aspiring children itself. @@ -877,8 +882,7 @@ if needevolve and opts['evolve']: hint = _(b'use `hg amend`, `hg revert` or `hg shelve`') cmdutil.bailifchanged(repo, hint=hint) - - if not (opts['merge'] or (needevolve and opts['evolve'])): + elif not opts['merge']: # we only skip the check if noconflict is set if ui.config(b'commands', b'update.check') == b'noconflict': pass
--- a/hgext3rd/evolve/metadata.py Sat Apr 24 21:34:57 2021 +0800 +++ b/hgext3rd/evolve/metadata.py Thu May 27 23:58:50 2021 +0800 @@ -5,7 +5,7 @@ # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. -__version__ = b'10.3.1.dev' -testedwith = b'4.6.2 4.7 4.8 4.9 5.0 5.1 5.2 5.3 5.4 5.5 5.6 5.7' +__version__ = b'10.3.2.dev' +testedwith = b'4.6.2 4.7 4.8 4.9 5.0 5.1 5.2 5.3 5.4 5.5 5.6 5.7 5.8' minimumhgversion = b'4.6' buglink = b'https://bz.mercurial-scm.org/'
--- a/hgext3rd/evolve/safeguard.py Sat Apr 24 21:34:57 2021 +0800 +++ b/hgext3rd/evolve/safeguard.py Thu May 27 23:58:50 2021 +0800 @@ -38,6 +38,10 @@ published = repo.filtered(b'served').revs(b"not public()") else: published = repo.revs(b"::%ln - public()", pushop.revs) + # we want to use pushop.revs in the revset even if they + # themselves are secret, but we don't want to have anything + # that the server won't see in the result of this expression + published &= repo.filtered(b'served') if published: if behavior == b'warn': ui.warn(_(b'%i changesets about to be published\n')
--- a/hgext3rd/topic/__init__.py Sat Apr 24 21:34:57 2021 +0800 +++ b/hgext3rd/topic/__init__.py Thu May 27 23:58:50 2021 +0800 @@ -232,9 +232,9 @@ b'topic.active': b'green', } -__version__ = b'0.22.1.dev' +__version__ = b'0.22.2.dev' -testedwith = b'4.6.2 4.7 4.8 4.9 5.0 5.1 5.2 5.3 5.4 5.5 5.6 5.7' +testedwith = b'4.6.2 4.7 4.8 4.9 5.0 5.1 5.2 5.3 5.4 5.5 5.6 5.7 5.8' minimumhgversion = b'4.6' buglink = b'https://bz.mercurial-scm.org/' @@ -590,7 +590,9 @@ topicmodeserver = self.ui.config(b'experimental', b'topic-mode.server', b'ignore') - ispush = (desc.startswith(b'push') or desc.startswith(b'serve')) + publishbare = self.ui.configbool(b'experimental', + b'topic.publish-bare-branch') + ispush = desc.startswith((b'push', b'serve')) if (topicmodeserver != b'ignore' and ispush): if util.safehasattr(tr, 'validator'): # hg <= 4.7 (ebbba3ba3f66) origvalidator = tr.validator @@ -616,10 +618,7 @@ else: tr.addvalidator(b'000-reject-untopiced', _validate) - elif (self.ui.configbool(b'experimental', b'topic.publish-bare-branch') - and (desc.startswith(b'push') - or desc.startswith(b'serve')) - ): + elif publishbare and ispush: origclose = tr.close trref = weakref.ref(tr) @@ -1059,6 +1058,14 @@ for r in revs: c = repo[r] + if len(c.parents()) > 1: + # ctx.files() isn't reliable for merges, so fall back to the + # slower repo.status() method + st = c.p1().status(c) + files = set(st.modified) | set(st.added) | set(st.removed) + else: + files = set(c.files()) + def filectxfn(repo, ctx, path): try: return c[path] @@ -1097,7 +1104,7 @@ mc = context.memctx(repo, (p1, p2), c.description(), - c.files(), + files, filectxfn, user=c.user(), date=c.date(),
--- a/hgext3rd/topic/flow.py Sat Apr 24 21:34:57 2021 +0800 +++ b/hgext3rd/topic/flow.py Thu May 27 23:58:50 2021 +0800 @@ -152,6 +152,11 @@ published = repo.filtered(b'served').revs(b'not public()') else: published = repo.revs(b'::%ln - public()', pushop.revs) + # we want to use pushop.revs in the revset even if they themselves are + # secret, but we don't want to have anything that the server won't see + # in the result of this expression + published &= repo.filtered(b'served') + if mode == b'auto': published = repo.revs(b'%ld::(%ld - topic())', published, published) if published:
--- a/hgext3rd/topic/server.py Sat Apr 24 21:34:57 2021 +0800 +++ b/hgext3rd/topic/server.py Thu May 27 23:58:50 2021 +0800 @@ -71,6 +71,13 @@ caps = orig(repo, proto) if common.hastopicext(repo) and repo.peer().capable(b'topics'): caps.append(b'_exttopics_heads') + if repo.ui.configbool(b'phases', b'publish'): + mode = b'all' + elif repo.ui.configbool(b'experimental', b'topic.publish-bare-branch'): + mode = b'auto' + else: + mode = b'none' + caps.append(b'ext-topics-publish=%s' % mode) return caps def setupserver(ui):
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test-amend-merge.t Thu May 27 23:58:50 2021 +0800 @@ -0,0 +1,98 @@ +This test amends a merge commit using various commands, including topics + + $ . $TESTDIR/testlib/common.sh + + $ cat >> $HGRCPATH << EOF + > [extensions] + > evolve = + > topic = + > EOF + + $ hg init amending-a-merge + $ cd amending-a-merge + + $ mkcommit root + $ mkcommit apple + $ hg up 'desc("root")' + 0 files updated, 0 files merged, 1 files removed, 0 files unresolved + $ mkcommit banana + created new head + (consider using topic for lightweight branches. See 'hg help topic') + $ hg up 'desc("apple")' + 1 files updated, 0 files merged, 1 files removed, 0 files unresolved + $ hg merge 'desc("banana")' + 1 files updated, 0 files merged, 0 files removed, 0 files unresolved + (branch merge, don't forget to commit) + + $ hg ci -m merge + $ hg diff -r 'p1(.)' -r '.' + diff -r 88a060ab6523 -r c20705a6a8c4 banana + --- /dev/null Thu Jan 01 00:00:00 1970 +0000 + +++ b/banana Thu Jan 01 00:00:00 1970 +0000 + @@ -0,0 +1,1 @@ + +banana + $ hg diff -r 'p2(.)' -r '.' + diff -r d8c7baf0ca58 -r c20705a6a8c4 apple + --- /dev/null Thu Jan 01 00:00:00 1970 +0000 + +++ b/apple Thu Jan 01 00:00:00 1970 +0000 + @@ -0,0 +1,1 @@ + +apple + +amend + + $ hg amend -m 'merge, amend' + $ hg diff -r 'p1(.)' -r '.' + diff -r 88a060ab6523 -r 456753fae3cd banana + --- /dev/null Thu Jan 01 00:00:00 1970 +0000 + +++ b/banana Thu Jan 01 00:00:00 1970 +0000 + @@ -0,0 +1,1 @@ + +banana + $ hg diff -r 'p2(.)' -r '.' + diff -r d8c7baf0ca58 -r 456753fae3cd apple + --- /dev/null Thu Jan 01 00:00:00 1970 +0000 + +++ b/apple Thu Jan 01 00:00:00 1970 +0000 + @@ -0,0 +1,1 @@ + +apple + +metaedit + + $ hg metaedit -m 'merge, metaedit' + 0 files updated, 0 files merged, 0 files removed, 0 files unresolved + $ hg diff -r 'p1(.)' -r '.' + diff -r 88a060ab6523 -r 1528d42f3e83 banana + --- /dev/null Thu Jan 01 00:00:00 1970 +0000 + +++ b/banana Thu Jan 01 00:00:00 1970 +0000 + @@ -0,0 +1,1 @@ + +banana + $ hg diff -r 'p2(.)' -r '.' + diff -r d8c7baf0ca58 -r 1528d42f3e83 apple + --- /dev/null Thu Jan 01 00:00:00 1970 +0000 + +++ b/apple Thu Jan 01 00:00:00 1970 +0000 + @@ -0,0 +1,1 @@ + +apple + +topics + + $ hg topics -r . foo + switching to topic foo + changed topic on 1 changesets to "foo" + $ hg diff -r 'p1(.)' -r '.' + diff -r 88a060ab6523 -r 52150b9639f7 banana + --- /dev/null Thu Jan 01 00:00:00 1970 +0000 + +++ b/banana Thu Jan 01 00:00:00 1970 +0000 + @@ -0,0 +1,1 @@ + +banana + $ hg diff -r 'p2(.)' -r '.' + diff -r d8c7baf0ca58 -r 52150b9639f7 apple + --- /dev/null Thu Jan 01 00:00:00 1970 +0000 + +++ b/apple Thu Jan 01 00:00:00 1970 +0000 + @@ -0,0 +1,1 @@ + +apple + + $ hg files + apple + banana + root + $ hg cat apple banana + apple + banana
--- a/tests/test-check-sdist.t Sat Apr 24 21:34:57 2021 +0800 +++ b/tests/test-check-sdist.t Thu May 27 23:58:50 2021 +0800 @@ -35,7 +35,7 @@ $ tar -tzf hg-evolve-*.tar.gz | sed 's|^hg-evolve-[^/]*/||' | sort > files $ wc -l files - 348 files + 349 files $ fgrep debian files tests/test-check-debian.t $ fgrep __init__.py files
--- a/tests/test-extension-isolation.t Sat Apr 24 21:34:57 2021 +0800 +++ b/tests/test-extension-isolation.t Thu May 27 23:58:50 2021 +0800 @@ -132,6 +132,7 @@ [1] $ hg debugcapabilities http://$LOCALIP:$HGPORT/repo-topic | egrep 'topics|evoext' _exttopics_heads + ext-topics-publish=all topics $ hg debugcapabilities http://$LOCALIP:$HGPORT/repo-no-ext | egrep 'topics|evoext' [1] @@ -145,12 +146,14 @@ _evoext_getbundle_obscommon _evoext_obshashrange_v1 _exttopics_heads + ext-topics-publish=all topics $ hg debugcapabilities http://$LOCALIP:$HGPORT/repo-evo | egrep 'topics|evoext' _evoext_getbundle_obscommon _evoext_obshashrange_v1 $ hg debugcapabilities http://$LOCALIP:$HGPORT/repo-topic | egrep 'topics|evoext' _exttopics_heads + ext-topics-publish=all topics $ hg debugcapabilities http://$LOCALIP:$HGPORT/repo-evo | egrep 'topics|evoext' _evoext_getbundle_obscommon
--- a/tests/test-obsolete-push.t Sat Apr 24 21:34:57 2021 +0800 +++ b/tests/test-obsolete-push.t Thu May 27 23:58:50 2021 +0800 @@ -60,7 +60,7 @@ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd strict-publish-client $ echo c > c - $ hg ci -qAm C c + $ hg ci -qAm C c --secret abort behavior @@ -70,6 +70,17 @@ > eof $ hg push -r . pushing to $TESTTMP/source + searching for changes + no changes found (ignored 1 secret changesets) + [1] + $ hg push + pushing to $TESTTMP/source + searching for changes + no changes found (ignored 1 secret changesets) + [1] + $ hg phase --draft + $ hg push -r . + pushing to $TESTTMP/source abort: push would publish 1 changesets (* 'experimental.auto-publish' config) (glob) [255]
--- a/tests/test-prev-next.t Sat Apr 24 21:34:57 2021 +0800 +++ b/tests/test-prev-next.t Thu May 27 23:58:50 2021 +0800 @@ -603,3 +603,58 @@ move:[4] B atop:[5] B modified working directory is now at 1b434459c7e7 + + $ cd .. + +Testing --merge and --evolve flags: 1 child, 1 aspchild, dirty working copy + + $ hg init next-dirty-evolve + $ cd next-dirty-evolve + + $ echo apple > a + $ hg ci -qAm apple + $ echo banana > b + $ hg ci -qAm banana + $ echo coconut > c + $ hg ci -qAm coconut + + $ hg prev + 0 files updated, 0 files merged, 1 files removed, 0 files unresolved + [1] banana + $ echo blueberry > b + $ hg ci --amend -m blueberry + 1 new orphan changesets + + $ echo durian > d + $ hg ci -qAm durian + $ hg log -GT "{rev} {desc}\n" + @ 4 durian + | + o 3 blueberry + | + | * 2 coconut + | | + | x 1 banana + |/ + o 0 apple + + + $ hg up 'desc("blueberry")' + 0 files updated, 0 files merged, 1 files removed, 0 files unresolved + $ echo avocado > a + + $ hg next --no-merge --evolve --dry-run + abort: uncommitted changes + (use `hg amend`, `hg revert` or `hg shelve`) + [255] + $ hg next --no-merge --no-evolve --dry-run + abort: uncommitted changes + (do you want --merge?) + [255] + $ hg next --merge --no-evolve --dry-run + hg update db0dc1f00682; + [4] durian + $ hg next --merge --evolve --dry-run + abort: uncommitted changes + (use `hg amend`, `hg revert` or `hg shelve`) + [255]
--- a/tests/test-topic-flow-publish-bare.t Sat Apr 24 21:34:57 2021 +0800 +++ b/tests/test-topic-flow-publish-bare.t Thu May 27 23:58:50 2021 +0800 @@ -5,6 +5,17 @@ $ . "$TESTDIR/testlib/topic_setup.sh" $ . "$TESTDIR/testlib/common.sh" +Also testing auto-publish config option with this publishing mode + + $ cat << EOF >> "$HGRCPATH" + > [ui] + > ssh = "$PYTHON" "$RUNTESTDIR/dummyssh" + > [experimental] + > auto-publish = warn + > [alias] + > tgl = log --rev 'sort(\$1, "topo")' -GT '{rev}:{node|short} {desc} {phase} {branch} {topics}' + > EOF + Publishing of bare branch ========================= @@ -32,12 +43,13 @@ $ mkcommit c_dB0 $ hg push pushing to $TESTTMP/bare-branch-server + 1 changesets about to be published searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files - $ hg log --rev 'sort(all(), "topo")' -GT '{rev}:{node|short} {desc} {phase} {branch} {topics}' + $ hg tgl 'all()' @ 2:286d02a6e2a2 c_dB0 public default | o 1:134bc3852ad2 c_dA0 public default @@ -60,12 +72,13 @@ (consider using topic for lightweight branches. See 'hg help topic') $ hg push -f pushing to $TESTTMP/bare-branch-server + 2 changesets about to be published searching for changes adding changesets adding manifests adding file changes added 2 changesets with 2 changes to 2 files (+2 heads) - $ hg log --rev 'sort(all(), "topo")' -GT '{rev}:{node|short} {desc} {phase} {branch} {topics}' + $ hg tgl 'all()' @ 4:9bf953aa81f6 c_dD0 public default | | o 3:9d5b8e1f08a4 c_dC0 public default @@ -88,12 +101,13 @@ $ mkcommit c_aE0 $ hg push --new-branch pushing to $TESTTMP/bare-branch-server + 1 changesets about to be published searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files (+1 heads) - $ hg log --rev 'sort(all(), "topo")' -GT '{rev}:{node|short} {desc} {phase} {branch} {topics}' + $ hg tgl 'all()' @ 5:0db08e758601 c_aE0 public branchA | | o 4:9bf953aa81f6 c_dD0 public default @@ -124,7 +138,7 @@ adding manifests adding file changes added 1 changesets with 1 changes to 1 files - $ hg log --rev 'sort(all(), "topo")' -GT '{rev}:{node|short} {desc} {phase} {branch} {topics}' + $ hg tgl 'all()' @ 6:0867c4471796 c_dF0 draft default foo | o 4:9bf953aa81f6 c_dD0 public default @@ -153,12 +167,13 @@ (see 'hg help topics' for more information) $ hg push pushing to $TESTTMP/bare-branch-server + 1 changesets about to be published searching for changes adding changesets adding manifests adding file changes added 2 changesets with 2 changes to 2 files - $ hg log --rev 'sort(all(), "topo")' -GT '{rev}:{node|short} {desc} {phase} {branch} {topics}' + $ hg tgl 'all()' @ 8:858be9a8daaf c_dH0 draft default bar | o 7:0e4041d324d0 c_dG0 public default @@ -193,12 +208,13 @@ $ mkcommit c_aK0 $ hg push pushing to $TESTTMP/bare-branch-server + 2 changesets about to be published searching for changes adding changesets adding manifests adding file changes added 3 changesets with 3 changes to 3 files - $ hg log --rev 'sort(all(), "topo")' -GT '{rev}:{node|short} {desc} {phase} {branch} {topics}' + $ hg tgl 'all()' @ 11:b0a00ebdfd24 c_aK0 public branchA | o 5:0db08e758601 c_aE0 public branchA @@ -235,12 +251,13 @@ $ hg ci -m 'c_dL0' $ hg push pushing to $TESTTMP/bare-branch-server + 2 changesets about to be published searching for changes adding changesets adding manifests adding file changes added 1 changesets with 0 changes to 0 files (-1 heads) - $ hg log --rev 'sort(all(), "topo")' -GT '{rev}:{node|short} {desc} {phase} {branch} {topics}' + $ hg tgl 'all()' @ 12:a6f9f8c6c6cc c_dL0 public default |\ | o 9:4b5570d89f0f c_dI0 public default @@ -267,7 +284,7 @@ |/ o 0:ea207398892e ROOT public default - $ hg log -R ../bare-branch-server --rev 'sort(all(), "topo")' -GT '{rev}:{node|short} {desc} {phase} {branch} {topics}' + $ hg tgl 'all()' -R ../bare-branch-server o 12:a6f9f8c6c6cc c_dL0 public default |\ | o 9:4b5570d89f0f c_dI0 public default @@ -328,12 +345,33 @@ $ hg up branchA 2 files updated, 0 files merged, 5 files removed, 0 files unresolved +Making sure the topic-publishing mode is announced as a capability + + $ hg debugcapabilities $TESTTMP/bare-branch-server | grep topics + ext-topics-publish=auto + topics + $ hg debugcapabilities ssh://user@dummy/bare-branch-server | grep topics + _exttopics_heads + ext-topics-publish=auto + topics + $ hg serve -R ../bare-branch-server -p $HGPORT -d --pid-file hg.pid + $ cat hg.pid >> $DAEMON_PIDS + $ hg debugcapabilities http://localhost:$HGPORT | grep topics + _exttopics_heads + ext-topics-publish=auto + topics + $ killdaemons.py + Trying to push changeset without topic (would publish them) $ mkcommit c_aM0 - $ hg debugcapabilities $TESTTMP/bare-branch-server | grep topics - ext-topics-publish=auto - topics + $ hg phase --secret --force + $ hg push --config experimental.auto-publish=abort -r . + pushing to $TESTTMP/bare-branch-server + searching for changes + no changes found (ignored 1 secret changesets) + [1] + $ hg phase --draft $ hg push --config experimental.auto-publish=abort -r . pushing to $TESTTMP/bare-branch-server abort: push would publish 1 changesets @@ -351,7 +389,7 @@ $ hg topic test-push-protection marked working directory as topic: test-push-protection - $ mkcommit c_aL0 + $ mkcommit c_aN0 active topic 'test-push-protection' grew its first changeset (see 'hg help topics' for more information) $ hg push --config experimental.auto-publish=abort -r .
--- a/tests/test-topic-prev-next.t Sat Apr 24 21:34:57 2021 +0800 +++ b/tests/test-topic-prev-next.t Thu May 27 23:58:50 2021 +0800 @@ -133,8 +133,23 @@ o 0 [] root +Simply walking on unstable changesets should work as expected + + $ hg up 'desc("B2")' + switching to topic B + 3 files updated, 0 files merged, 0 files removed, 0 files unresolved + $ hg prev + 0 files updated, 0 files merged, 1 files removed, 0 files unresolved + [s1] B1 + $ hg next + 1 files updated, 0 files merged, 0 files removed, 0 files unresolved + [s2] B2 + B1 shouldn't be considered a target, orphan or not + $ hg up 'desc("A2")' + switching to topic A + 1 files updated, 0 files merged, 2 files removed, 0 files unresolved $ hg next move:[s3] A3 atop:[s2] A2