changeset 6146:74665d83fb3b

branching: merge stable into default
author Anton Shestakov <av6@dwimlabs.net>
date Mon, 21 Feb 2022 18:26:25 +0300
parents 1a20edff5cbd (current diff) 30ca8eb17b21 (diff)
children 900f9346978f 5bd5a7ab32d3
files .gitlab-ci.yml .gitlab/issue_templates/new-version.md CHANGELOG hgext3rd/topic/__init__.py tests/test-check-sdist.t
diffstat 8 files changed, 194 insertions(+), 28 deletions(-) [+]
line wrap: on
line diff
--- a/.gitlab-ci.yml	Tue Feb 22 19:42:55 2022 +0300
+++ b/.gitlab-ci.yml	Mon Feb 21 18:26:25 2022 +0300
@@ -1,5 +1,6 @@
 .prepare_hg: &prepare_hg
     - hg pull -R /ci/repos/mercurial/
+    - hg pull -R /ci/repos/mercurial/ https://www.mercurial-scm.org/repo/hg-committed
     - hg_branch=${HG_BRANCH:-$(tests/testlib/map-hg-rev.sh "$(hg identify --branch)")}
     - hg -R /ci/repos/mercurial/ update "$hg_branch"
     - hg_rev=$(hg log -R /ci/repos/mercurial/ -r . -T '{node}')
@@ -72,8 +73,7 @@
 doc:
     image: registry.heptapod.net/mercurial/ci-images/py3-evolve-doc
     script:
-        - cd docs/
-        - make
+        - make doc
     variables:
         LANG: en_US.UTF-8
         PYTHON: python3
--- a/.gitlab/issue_templates/new-version.md	Tue Feb 22 19:42:55 2022 +0300
+++ b/.gitlab/issue_templates/new-version.md	Mon Feb 21 18:26:25 2022 +0300
@@ -1,28 +1,28 @@
 This is the actual check list for releasing evolve version X.Y.Z
 
-More details in the [README.rst file](README.rst#L199).
+More details in the [README.rst file](README.rst#L210).
 
 Preparation
 
 * [ ] merges with compatibility branches
 * [ ] compatibility tests are happy
 * [ ] update `testedwith` field
-* [ ] make sure the changelog is up to data
-* [ ] [prepare an announcement for the list/website](https://mypads.framapad.org/mypads/?/mypads/group/octobus-public-5d3rw470w/pad/view/evolution-announce-iswcp7qx)
+* [ ] make sure CHANGELOG is up-to-date
+* [ ] [prepare an announcement for the list/website](https://mypads.framapad.org/p/evolution-announce-iswcp7qx)
 * [ ] sanity check install and sdist targets of setup.py
 
 Releasing
 
-* [ ] add the current date to the changelog
+* [ ] add the current date to CHANGELOG
 * [ ] update the `__version__` field of all relevant extensions
 * [ ] create a new Debian entry
 * [ ] tag the version
-* [ ] move the `@` bookmark on the new tag
+* [ ] move the `@` bookmark to the new tag
 * [ ] push/publish the tag to the main repository
 * [ ] upload the tarball to PyPI
 * [ ] add `.dev` to the `__version__` field
 * [ ] merge stable into default
-* [ ] push the result on the main repo
+* [ ] push the result to https://www.mercurial-scm.org/repo/evolve/
 * [ ] send the announcement by email to evolve-testers@mercurial-scm.org
 * [ ] send the announcement by email to mercurial@mercurial-scm.org
 * [ ] publish the announcement as a blog on https://octobus.net/blog/
--- a/CHANGELOG	Tue Feb 22 19:42:55 2022 +0300
+++ b/CHANGELOG	Mon Feb 21 18:26:25 2022 +0300
@@ -11,7 +11,14 @@
     specified revision
   * pick: show abort message after pick is aborted for consistency
 
-  * evolve, topic, pullbundle: drop compatibility with Mercurial 4.7
+  * evolve, pullbundle: drop compatibility with Mercurial 4.7
+
+topic (0.24.0)
+
+  * topic: make histedit preserve topics when the first changeset in a stack
+    is rewritten (issue6550)
+
+  * drop compatibility with Mercurial 4.7
 
 10.4.1 -- 2021-11-19
 --------------------
--- a/Makefile	Tue Feb 22 19:42:55 2022 +0300
+++ b/Makefile	Mon Feb 21 18:26:25 2022 +0300
@@ -1,5 +1,5 @@
 PYTHON ?= python3
-VERSION = $(shell python setup.py --version)
+VERSION = $(shell $(PYTHON) setup.py --version)
 TESTFLAGS ?= $(shell echo $$HGTESTFLAGS)
 HGTESTS = $(HGROOT)/tests
 
@@ -15,7 +15,7 @@
 
 .PHONY: deb-prepare
 deb-prepare:
-	python setup.py sdist --dist-dir ..
+	$(PYTHON) setup.py sdist --dist-dir ..
 	mv -f ../hg-evolve-$(VERSION).tar.gz ../mercurial-evolve_$(VERSION).orig.tar.gz
 	tar xf ../mercurial-evolve_$(VERSION).orig.tar.gz
 	rm -rf ../mercurial-evolve_$(VERSION).orig
--- a/README.rst	Tue Feb 22 19:42:55 2022 +0300
+++ b/README.rst	Mon Feb 21 18:26:25 2022 +0300
@@ -76,6 +76,17 @@
     [extensions]
     evolve = ~/evolve/hgext3rd/evolve
 
+Pitfalls
+--------
+
+If you get ``"failed to import extension evolve: No module named 'evolve'"``
+error, there are a couple of things to check:
+
+* make sure you gave pip the correct package name (it's hg-evolve),
+
+* make sure evolve is installed for the same version of Python that you use for
+  running Mercurial (``hg debuginstall | grep Python``).
+
 Server-only Setup
 =================
 
@@ -117,7 +128,7 @@
 How to Contribute
 =================
 
-Discussion happens on the #hg-evolve IRC on libera_.
+Discussion happens in #hg-evolve and #mercurial on libera_ IRC network.
 
 .. _libera: https://libera.chat/
 
@@ -199,31 +210,31 @@
 Release Checklist
 =================
 
+* use contrib/merge-test-compat.sh to merge with the test compatibility
+  branches,
+
 * make sure the tests are happy on all supported versions,
 
-  You can use the `contrib/merge-test-compat.sh` to merge with the test
-  compatibility branches.
+* make sure there is no code difference between the compatibility branches and
+  stable (no diff within hgext3rd/),
 
-* make sure there is no code difference between the compat branches and stable
-  (no diff within `hgext3rd/`),
-
-* update the `testedwith` variable for all extensions (remove '.dev'):
+* update the ``testedwith`` variable for all extensions (remove '.dev'):
 
   - hgext3rd/evolve/metadata.py
   - hgext3rd/topic/__init__.py
   - hgext3rd/pullbundle.py
 
-* make sure the changelog is up to date,
+* make sure CHANGELOG is up-to-date,
 
-* add a date to the changelog entry for the target version,
+* add a date to the CHANGELOG entry for the target version,
 
-* update the `__version__` field of all relevant extensions:
+* update the ``__version__`` field of all relevant extensions:
 
   - hgext3rd/evolve/metadata.py
   - hgext3rd/topic/__init__.py
   - hgext3rd/pullbundle.py (if touched)
 
-* create a new Debian entry:
+* create a new Debian changelog entry:
 
   - debchange --newversion x.y.z-1 "new upstream release"
   - debchange --release
@@ -235,21 +246,25 @@
 
 * tag the commit,
 
+* move ``@`` bookmark to the new tag,
+
 * push and publish the tag,
 
 * upload the tarball to PyPI,
 
-* make an announcement on evolve-testers@mercurial-scm.org (possibly on
-  mercurial@mercurial-scm.org too),
+* make an announcement on evolve-testers@mercurial-scm.org and
+  mercurial@mercurial-scm.org,
 
-* bump versions of all extensions and add '.dev' (see existing commits as an
+* bump versions of all extensions and add ``.dev`` (see existing commits as an
   example):
 
   - hgext3rd/evolve/metadata.py
   - hgext3rd/topic/__init__.py
   - hgext3rd/pullbundle.py
 
-  The version we use on the stable branch during development should be
-  `x.y.z+1.dev`. The version of the default branch should be `x.y+1.0.dev`.
+  Version bump rules:
+
+  - stable branch x.y.z+1.dev
+  - default branch x.y+1.0.dev
 
 * merge stable into default.
--- a/hgext3rd/topic/__init__.py	Tue Feb 22 19:42:55 2022 +0300
+++ b/hgext3rd/topic/__init__.py	Mon Feb 21 18:26:25 2022 +0300
@@ -440,6 +440,15 @@
         except (KeyError, AttributeError):
             pass
 
+    try:
+        histedit = extensions.find(b'histedit')
+    except KeyError:
+        pass
+    else:
+        # Make histedit preserve topics of edited commits
+        extensions.wrapfunction(histedit.histeditaction, 'applychange',
+                                applychangewrap)
+
     server.setupserver(ui)
 
 def reposetup(ui, repo):
@@ -732,6 +741,17 @@
     return orig(cl, manifest, files, desc, transaction, p1, p2, user,
                 date=date, extra=extra, **kwargs)
 
+def applychangewrap(orig, self):
+    orig(self)
+    repo = self.repo
+    rulectx = repo[self.node]
+
+    topic = None
+    if util.safehasattr(rulectx, 'topic'):
+        topic = rulectx.topic()
+    _changecurrenttopic(repo, topic)
+
+
 # revset predicates are automatically registered at loading via this symbol
 revsetpredicate = topicrevset.revsetpredicate
 
--- a/tests/test-check-sdist.t	Tue Feb 22 19:42:55 2022 +0300
+++ b/tests/test-check-sdist.t	Mon Feb 21 18:26:25 2022 +0300
@@ -35,7 +35,7 @@
 
   $ tar -tzf hg-evolve-*.tar.gz | sed 's|^hg-evolve-[^/]*/||' | sort > files
   $ wc -l files
-  355 files
+  356 files
   $ fgrep debian files
   tests/test-check-debian.t
   $ fgrep __init__.py files
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-issue6550.t	Mon Feb 21 18:26:25 2022 +0300
@@ -0,0 +1,124 @@
+histedit should preserve topics (issue6550)
+https://bz.mercurial-scm.org/show_bug.cgi?id=6550
+
+  $ . "$TESTDIR/testlib/topic_setup.sh"
+
+  $ cat << EOF >> "$HGRCPATH"
+  > [extensions]
+  > histedit =
+  > [alias]
+  > glog = log -G --template "{rev}:{node|short} [{topic}] {desc}\n"
+  > EOF
+
+Editing commits with one topic on top of a commit with a different topic:
+
+  $ hg init repo1
+  $ cd repo1
+  $ hg topic topic1
+  marked working directory as topic: topic1
+  $ echo 1 > A
+  $ hg ci -Aqm A
+  $ hg topic topic2
+  $ echo 1 > B
+  $ hg ci -Aqm B
+  $ echo 1 > C
+  $ hg ci -Aqm C
+  $ hg glog
+  @  2:392a64d00726 [topic2] C
+  |
+  o  1:8a25a1549e46 [topic2] B
+  |
+  o  0:c051488dac25 [topic1] A
+  
+Swap the order of commits B and C
+
+  $ hg histedit s1 -q --commands - 2>&1 << EOF
+  > pick 392a64d00726 C
+  > pick 8a25a1549e46 B
+  > EOF
+
+Topic of B and C is preserved
+
+  $ hg glog
+  @  4:065a99df807b [topic2] B
+  |
+  o  3:43dddca3e1d1 [topic2] C
+  |
+  o  0:c051488dac25 [topic1] A
+  
+  $ cd ..
+
+Editing commits without a topic on top of a commit with a topic:
+
+  $ hg init repo2
+  $ cd repo2
+  $ hg topic topic1
+  marked working directory as topic: topic1
+  $ echo 1 > A
+  $ hg ci -Aqm A
+  $ hg topic --clear
+  $ echo 1 > B
+  $ hg ci -Aqm B
+  $ echo 1 > C
+  $ hg ci -Aqm C
+  $ hg glog
+  @  2:c47acbb860b3 [] C
+  |
+  o  1:e2e2ca96a6bb [] B
+  |
+  o  0:c051488dac25 [topic1] A
+  
+Swap the order of commits B and C
+
+  $ hg histedit s1 -q --commands - 2>&1 << EOF
+  > pick c47acbb860b3 C
+  > pick e2e2ca96a6bb B
+  > EOF
+
+B and C still don't have a topic
+
+  $ hg glog
+  @  4:ff3439fe6f3d [] B
+  |
+  o  3:bb6fab1a29c6 [] C
+  |
+  o  0:c051488dac25 [topic1] A
+  
+  $ cd ..
+
+Editing commits with a topic on top of a commit without a topic:
+
+  $ hg init repo3
+  $ cd repo3
+  $ echo 1 > A
+  $ hg ci -Aqm A
+  $ hg topic topic1
+  marked working directory as topic: topic1
+  $ echo 1 > B
+  $ hg ci -Aqm B
+  $ echo 1 > C
+  $ hg ci -Aqm C
+  $ hg glog
+  @  2:c3dae6eda73b [topic1] C
+  |
+  o  1:db3a7c9052ac [topic1] B
+  |
+  o  0:a18fe624bf77 [] A
+  
+Swap the order of commits B and C
+
+  $ hg histedit s1 -q --commands - 2>&1 << EOF
+  > pick c3dae6eda73b C
+  > pick db3a7c9052ac B
+  > EOF
+
+Topic of B and C is preserved
+
+  $ hg glog
+  @  4:aa7af5cc1567 [topic1] B
+  |
+  o  3:4bf8cf7b2c73 [topic1] C
+  |
+  o  0:a18fe624bf77 [] A
+  
+  $ cd ..