This instance will be upgraded to Heptapod 0.23.2 on 2021-08-05 at 11:00 UTC+2 (a few minutes of down time)

Commit c03d9668 authored by Pierre-Yves David's avatar Pierre-Yves David 🐙
Browse files

branching: merge with stable into default

Pipeline #13538 passed with stage
in 4 minutes and 6 seconds
......@@ -70,13 +70,15 @@ tests-py3-pure:
TEST_HGMODULEPOLICY: "py"
doc:
image: octobus/ci-py2-evolve-doc
image: octobus/ci-py3-evolve-doc
script:
- cd docs/
- make
variables:
LANG: en_us.UTF-8
LANG: en_US.UTF-8
PYTHON: python3
PYTHONPATH: "/ci/repos/mercurial:$PYTHONPATH"
SPHINXBUILD: python3 -m sphinx -b html
artifacts:
paths:
- html/*
......@@ -2,12 +2,22 @@
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
from mercurial import demandimport
demandimport.disable()
from os.path import (
abspath,
dirname,
join,
)
from docutils import nodes
from docutils.parsers.rst import Directive
from mercurial import ui
from mercurial import extensions as hgext
from mercurial import commands
import os
from mercurial import (
commands,
extensions as hgext,
pycompat,
ui as uimod,
)
extensions = ["sphinx.ext.graphviz"]
......@@ -139,20 +149,17 @@ class hghelpdirective(Directive):
has_content = True
def run(self):
u = ui.ui()
if not hasattr(u, 'disablepager'):
ui = uimod.ui()
if not hasattr(ui, 'disablepager'):
return []
u.disablepager()
u.setconfig(
'extensions', 'evolve',
os.path.join(
os.path.abspath(os.path.dirname(__file__)),
os.pardir, 'hgext3rd', 'evolve'))
hgext.loadall(u)
u.pushbuffer()
commands.help_(u, self.content[0].encode('utf-8'))
return [
nodes.literal_block(text=u.popbuffer().decode('utf-8'))]
ui.disablepager()
rootdir = abspath(dirname(dirname(__file__)))
evolvepath = join(rootdir, 'hgext3rd', 'evolve')
ui.setconfig(b'extensions', b'evolve', pycompat.bytestr(evolvepath))
hgext.loadall(ui)
ui.pushbuffer()
commands.help_(ui, self.content[0].encode('utf-8'))
return [nodes.literal_block(text=ui.popbuffer().decode('utf-8'))]
def setup(app):
......
SPHINXBUILD ?= sphinx-build
SPHINXBUILD ?= python3 -m sphinx -b html
.PHONY: all
all: tutorials/tutorial.rst tutorials/topic-tutorial.rst static/logo-evolve.ico
$(SPHINXBUILD) . ../html/
tutorials/tutorial.rst: tutorials/tutorial.t test2rst.py
python test2rst.py tutorials/
python3 test2rst.py $<
tutorials/topic-tutorial.rst: tutorials/topic-tutorial.t test2rst.py
python test2rst.py tutorials/
python3 test2rst.py $<
static/logo-evolve.ico: static/logo-evolve.svg
convert -resize 36x36 $< $@
......
#!/usr/bin/env python
#!/usr/bin/env python3
import re
import argparse
import os
import os.path as op
import sys
INDEX = '''
Mercurial tests
===============
import re
.. toctree::
:maxdepth: 1
'''
ignored_patterns = [
re.compile(r'^#if'),
......@@ -21,7 +13,8 @@ ignored_patterns = [
]
def rstify(orig, name):
def rstify(orig):
"""Take contents of a .t file and produce reStructuredText"""
newlines = []
code_block_mode = False
......@@ -29,7 +22,7 @@ def rstify(orig, name):
for line in orig.splitlines():
# Emtpy lines doesn't change output
# Empty lines doesn't change output
if not line:
newlines.append(line)
code_block_mode = False
......@@ -67,40 +60,19 @@ def rstify(orig, name):
return "\n".join(newlines)
def main(base):
if os.path.isdir(base):
one_dir(base)
else:
one_file(base)
def one_dir(base):
index = INDEX
# doc = lambda x: op.join(op.dirname(__file__), 'docs', x)
for fn in sorted(os.listdir(base)):
if not fn.endswith('.t'):
continue
name = os.path.splitext(fn)[0]
content = one_file(op.join(base, fn))
target = op.join(base, name + '.rst')
# with file(doc(name + '.rst'), 'w') as f:
with open(target, 'w') as f:
f.write(content)
index += '\n ' + name
# with file(doc('index.rst'), 'w') as f:
# f.write(index)
def main():
ap = argparse.ArgumentParser()
ap.add_argument('testfile', help='.t file to transform')
opts = ap.parse_args()
def one_file(path):
name = os.path.basename(path)[:-2]
return rstify(open(path).read(), name)
with open(opts.testfile) as f:
content = f.read()
rst = rstify(content)
target = os.path.splitext(opts.testfile)[0] + '.rst'
with open(target, 'w') as f:
f.write(rst)
if __name__ == '__main__':
if len(sys.argv) != 2:
print('Please supply a path to tests dir as parameter')
sys.exit()
main(sys.argv[1])
main()
#require test-repo
Enable obsolescence to avoid the warning issue when obsmarker are found
Enable obsolescence to avoid the warning issue when obsmarkers are found
$ cat << EOF >> $HGRCPATH
> [experimental]
> evolution = all
> [diff]
> git = yes
> [experimental]
> evolution=all
> EOF
Go back in the hg repo
......
#require test-repo
Enable obsolescence to avoid the warning issue when obsmarkers are found
$ cat << EOF >> $HGRCPATH
......
......@@ -4,7 +4,7 @@ Copied from Mercurial core (60ee2593a270)
$ cd "`dirname "$TESTDIR"`"
run flake8 if it exists; if it doesn't, then just skip
run flake8 on all tracked files ending in .py or with a python shebang
$ hg files -0 'set:(**.py or grep("^#!.*python")) - removed()' \
> -X hgext3rd/evolve/thirdparty \
......
......@@ -4,8 +4,7 @@ Copied from Mercurial core (60ee2593a270)
$ cd "`dirname "$TESTDIR"`"
run pyflakes on all tracked files ending in .py or without a file ending
(skipping binary file random-seed)
run pyflakes on all tracked files ending in .py or with a python shebang
$ hg files -0 'set:(**.py or grep("^#!.*python")) - removed()' \
> -X hgext3rd/evolve/thirdparty \
......
#require test-repo check-manifest
Enable obsolescence to avoid the warning issue when obsmarkers are found
$ cat << EOF >> $HGRCPATH
> [experimental]
> evolution=all
> evolution = all
> EOF
Run check manifest:
......
#require test-repo
Enable obsolescence to avoid the warning issue when obsmarkers are found
$ cat << EOF >> $HGRCPATH
> [experimental]
> evolution = all
> EOF
$ cd "$TESTDIR"/..
Checking all non-public tagged revisions up to the current commit, see our
release checklist for more ideas
$ for node in `hg log --rev 'tag() and ::. and not public() and not desc("# no-check-commit")' --template '{node|short}\n'`; do
> tags=`hg log --rev $node --template '{tags}\n'`
> if echo "$tags" | grep -q ' '; then
> echo "Revision $node is tagged multiple times: $tags"
> fi
> branch=`hg log --rev $node --template '{branch}\n'`
> if [ "$branch" != "stable" ]; then
> echo "Revision $node is not on stable branch: $branch"
> fi
> # Here we skip:
> # - pullbundle because it usually has no changes (so no version bump)
> # - serverminitopic because it's not actively maintained
> if hg grep --rev $node '^__version__ = .*\.dev' hgext3rd/evolve/ hgext3rd/topic/; then
> echo "Versions should not end with .dev at tagged revision $node"
> fi
> entry=`hg cat --rev $node CHANGELOG | fgrep "$tags"`
> if [ -z "$entry" ]; then
> echo "Revision $node has no CHANGELOG entry for $tags"
> fi
> if echo "$entry" | egrep -vq ' -- [0-9]{4}-[0-9]{2}-[0-9]{2}'; then
> echo "CHANGELOG entry for $tags should have a date in YYYY-MM-DD format: $entry"
> fi
> entry=`hg cat --rev $node debian/changelog | fgrep "$tags"`
> if [ -z "$entry" ]; then
> echo "Revision $node has no debian/changelog entry for $tags"
> fi
> done
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment