Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • mercurial/mercurial-devel
1 result
Show changes
Commits on Source (3)
......@@ -702,5 +702,6 @@
upload
--verbose
--repository-url ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/pypi
--skip-existing
wheels/*/*/*/*.whl
wheels/*/*.whl
......@@ -1029,4 +1029,5 @@
details about how to configure this feature.
"""
debug = repo.ui.configbool(b'devel', b'debug.clonebundles')
op_id = repo.ui.config(b'devel', b'clonebundles.override-operation-id')
bundles = read_auto_gen(repo)
......@@ -1032,5 +1033,6 @@
bundles = read_auto_gen(repo)
op_id = b"%d_acbr" % os.getpid()
if op_id is None:
op_id = b"%d_acbr" % os.getpid()
create, delete = auto_bundle_needed_actions(repo, bundles, op_id)
# if some bundles are scheduled for creation in the background, they will
......
......@@ -465,6 +465,15 @@
[[items]]
section = "devel"
name = "clonebundles.override-operation-id"
documentation = """
override the operation id used to produce unique filename at generation time.
Useful to stabilize some filename in the tests.
"""
[[items]]
section = "devel"
name = "check-locks"
default = false
......
......@@ -743,7 +743,7 @@
script = b' '.join(shellquote(x) for x in cmd)
if record_wait is None:
# double-fork to completely detach from the parent process
script = b'( %s ) &' % script
script = b'( ( %s ) <&3 3<&- &) 3<&0' % script
start_new_session = True
else:
start_new_session = False
......
......@@ -666,7 +666,9 @@
return 0, 0
@checkvers("pygments", "Pygments version >= %s", ('2.5', '2.11', '2.14'))
@checkvers(
"pygments", "Pygments version >= %s", ('2.5', '2.11', '2.14', '2.19')
)
def has_pygments_range(v):
major, minor = v.split('.')[0:2]
return getpygmentsversion() >= (int(major), int(minor))
......
......@@ -411,7 +411,56 @@
full-bzip2-v2-11_revs-4226b1cd5fda_tip-*_acbr.hg (glob)
$ ls -1 ../server/.hg/tmp-bundles
background generation without debug
-----------------------------------
The debug option make the command wait for background process and change the
way stdin is accessible to the script. So we also test this variant.
Gather the name of the expected bundle
$ v1_file=$TESTTMP/final-upload/full-bzip2-v1-11_revs-4226b1cd5fda_tip-background_testing.hg
$ v2_file=$TESTTMP/final-upload/full-bzip2-v2-11_revs-4226b1cd5fda_tip-background_testing.hg
cleanup things
$ hg -R ../server/ admin::clone-bundles-clear
clone-bundles: deleting bundle full-bzip2-v1-11_revs-4226b1cd5fda_tip-*_acbr.hg (glob)
clone-bundles: deleting bundle full-bzip2-v2-11_revs-4226b1cd5fda_tip-*_acbr.hg (glob)
(also delete the manifest to be sure)
$ rm ../server/.hg/clonebundles.manifest
Nothing should remain
$ cat ../server/.hg/clonebundles.auto-gen
$ ls -1 ../final-upload
$ ls -1 ../server/.hg/tmp-bundles
Start a process in the background without the debug option
$ hg -R ../server/ admin::clone-bundles-refresh --background \
> --config devel.debug.clonebundles=no \
> --config devel.clonebundles.override-operation-id=background_testing
$ $RUNTESTDIR/testlib/wait-on-file 30 $v1_file
$ $RUNTESTDIR/testlib/wait-on-file 30 $v2_file
We should have bundle now
$ cat ../server/.hg/clonebundles.manifest
file:/*/$TESTTMP/final-upload/full-bzip2-v1-11_revs-4226b1cd5fda_tip-background_testing.hg BUNDLESPEC=bzip2-v1 (glob)
file:/*/$TESTTMP/final-upload/full-bzip2-v2-11_revs-4226b1cd5fda_tip-background_testing.hg BUNDLESPEC=bzip2-v2 (glob)
$ ls -1 ../final-upload
full-bzip2-v1-11_revs-4226b1cd5fda_tip-background_testing.hg
full-bzip2-v2-11_revs-4226b1cd5fda_tip-background_testing.hg
$ ls -1 ../server/.hg/tmp-bundles
Test HTTP URL
=========================
$ hg -R ../server/ admin::clone-bundles-clear
......@@ -414,9 +463,9 @@
Test HTTP URL
=========================
$ hg -R ../server/ admin::clone-bundles-clear
clone-bundles: deleting bundle full-bzip2-v1-11_revs-4226b1cd5fda_tip-*_acbr.hg (glob)
clone-bundles: deleting bundle full-bzip2-v2-11_revs-4226b1cd5fda_tip-*_acbr.hg (glob)
clone-bundles: deleting bundle full-bzip2-v1-11_revs-4226b1cd5fda_tip-*.hg (glob)
clone-bundles: deleting bundle full-bzip2-v2-11_revs-4226b1cd5fda_tip-*.hg (glob)
$ cat >> ../server/.hg/hgrc << EOF
> [clone-bundles]
......
......@@ -160,5 +160,6 @@
<span id="l4"><span class="sd"> where sieve (p:ns) = p : sieve [n | n &lt;- ns, mod n p /= 0]</span></span><a href="#l4"></a>
<span id="l5"><span class="sd">&quot;&quot;&quot;</span></span><a href="#l5"></a>
<span id="l6"></span><a href="#l6"></a>
<span id="l7"><span class="kn">import</span> <span class="nn">itertools</span></span><a href="#l7"></a>
<span id="l7"><span class="kn">import</span><span class="w"> </span><span class="nn">itertools</span></span><a href="#l7"></a> (pygments219 !)
<span id="l7"><span class="kn">import</span> <span class="nn">itertools</span></span><a href="#l7"></a> (no-pygments219 !)
<span id="l8"></span><a href="#l8"></a>
......@@ -164,4 +165,5 @@
<span id="l8"></span><a href="#l8"></a>
<span id="l9"><span class="kn">def</span> <span class="nf">primes</span><span class="p">():</span></span><a href="#l9"></a>
<span id="l9"><span class="kn">def</span><span class="w"> </span><span class="nf">primes</span><span class="p">():</span></span><a href="#l9"></a> (pygments219 !)
<span id="l9"><span class="kn">def</span> <span class="nf">primes</span><span class="p">():</span></span><a href="#l9"></a> (no-pygments219 !)
<span id="l10"><span class="w"> </span><span class="sd">&quot;&quot;&quot;Generate all primes.&quot;&quot;&quot;</span></span><a href="#l10"></a> (pygments214 !)
<span id="l10"> <span class="sd">&quot;&quot;&quot;Generate all primes.&quot;&quot;&quot;</span></span><a href="#l10"></a> (no-pygments214 !)
......@@ -166,6 +168,7 @@
<span id="l10"><span class="w"> </span><span class="sd">&quot;&quot;&quot;Generate all primes.&quot;&quot;&quot;</span></span><a href="#l10"></a> (pygments214 !)
<span id="l10"> <span class="sd">&quot;&quot;&quot;Generate all primes.&quot;&quot;&quot;</span></span><a href="#l10"></a> (no-pygments214 !)
<span id="l11"> <span class="kn">def</span> <span class="nf">sieve</span><span class="p">(</span><span class="n">ns</span><span class="p">):</span></span><a href="#l11"></a>
<span id="l11"> <span class="kn">def</span><span class="w"> </span><span class="nf">sieve</span><span class="p">(</span><span class="n">ns</span><span class="p">):</span></span><a href="#l11"></a> (pygments219 !)
<span id="l11"> <span class="kn">def</span> <span class="nf">sieve</span><span class="p">(</span><span class="n">ns</span><span class="p">):</span></span><a href="#l11"></a> (no-pygments219 !)
<span id="l12"> <span class="n">p</span> <span class="o">=</span> <span class="n">ns</span><span class="o">.</span><span class="n">next</span><span class="p">()</span></span><a href="#l12"></a>
<span id="l13"> <span class="c"># It is important to yield *here* in order to stop the</span></span><a href="#l13"></a>
<span id="l14"> <span class="c"># infinite recursion.</span></span><a href="#l14"></a>
......@@ -179,7 +182,8 @@
<span id="l22"> <span class="kn">return</span> <span class="n">itertools</span><span class="o">.</span><span class="n">chain</span><span class="p">([</span><span class="mi">2</span><span class="p">],</span> <span class="n">sieve</span><span class="p">(</span><span class="n">dropwhile</span><span class="p">(</span><span class="kn">lambda</span> <span class="n">n</span><span class="p">:</span> <span class="n">n</span> <span class="o">&lt;</span> <span class="mi">3</span><span class="p">,</span> <span class="n">odds</span><span class="p">)))</span></span><a href="#l22"></a>
<span id="l23"></span><a href="#l23"></a>
<span id="l24"><span class="kn">if</span> <span class="n">__name__</span> <span class="o">==</span> <span class="s">&quot;__main__&quot;</span><span class="p">:</span></span><a href="#l24"></a>
<span id="l25"> <span class="kn">import</span> <span class="nn">sys</span></span><a href="#l25"></a>
<span id="l25"> <span class="kn">import</span><span class="w"> </span><span class="nn">sys</span></span><a href="#l25"></a> (pygments219 !)
<span id="l25"> <span class="kn">import</span> <span class="nn">sys</span></span><a href="#l25"></a> (no-pygments219 !)
<span id="l26"> <span class="kn">try</span><span class="p">:</span></span><a href="#l26"></a>
<span id="l27"> <span class="n">n</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">argv</span><span class="p">[</span><span class="mi">1</span><span class="p">])</span></span><a href="#l27"></a>
<span id="l28"> <span class="kn">except</span> <span class="p">(</span><span class="ne">ValueError</span><span class="p">,</span> <span class="ne">IndexError</span><span class="p">):</span></span><a href="#l28"></a>
......@@ -439,7 +443,8 @@
<a href="/rev/687f2d169546">changeset</a>
</div>
</td>
<td class="source followlines-btn-parent"><a href="#l7"> 7</a> <span class="kn">import</span> <span class="nn">itertools</span></td>
<td class="source followlines-btn-parent"><a href="#l7"> 7</a> <span class="kn">import</span><span class="w"> </span><span class="nn">itertools</span></td> (pygments219 !)
<td class="source followlines-btn-parent"><a href="#l7"> 7</a> <span class="kn">import</span> <span class="nn">itertools</span></td> (no-pygments219 !)
</tr>
<tr id="l8" class="thisrev">
<td class="annotate parity0">
......@@ -473,7 +478,8 @@
<a href="/rev/687f2d169546">changeset</a>
</div>
</td>
<td class="source followlines-btn-parent"><a href="#l9"> 9</a> <span class="kn">def</span> <span class="nf">primes</span><span class="p">():</span></td>
<td class="source followlines-btn-parent"><a href="#l9"> 9</a> <span class="kn">def</span><span class="w"> </span><span class="nf">primes</span><span class="p">():</span></td> (pygments219 !)
<td class="source followlines-btn-parent"><a href="#l9"> 9</a> <span class="kn">def</span> <span class="nf">primes</span><span class="p">():</span></td> (no-pygments219 !)
</tr>
<tr id="l10" class="thisrev">
<td class="annotate parity0">
......@@ -508,7 +514,8 @@
<a href="/rev/687f2d169546">changeset</a>
</div>
</td>
<td class="source followlines-btn-parent"><a href="#l11"> 11</a> <span class="kn">def</span> <span class="nf">sieve</span><span class="p">(</span><span class="n">ns</span><span class="p">):</span></td>
<td class="source followlines-btn-parent"><a href="#l11"> 11</a> <span class="kn">def</span><span class="w"> </span><span class="nf">sieve</span><span class="p">(</span><span class="n">ns</span><span class="p">):</span></td> (pygments219 !)
<td class="source followlines-btn-parent"><a href="#l11"> 11</a> <span class="kn">def</span> <span class="nf">sieve</span><span class="p">(</span><span class="n">ns</span><span class="p">):</span></td> (no-pygments219 !)
</tr>
<tr id="l12" class="thisrev">
<td class="annotate parity0">
......@@ -746,7 +753,8 @@
<a href="/rev/687f2d169546">changeset</a>
</div>
</td>
<td class="source followlines-btn-parent"><a href="#l25"> 25</a> <span class="kn">import</span> <span class="nn">sys</span></td>
<td class="source followlines-btn-parent"><a href="#l25"> 25</a> <span class="kn">import</span><span class="w"> </span><span class="nn">sys</span></td> (pygments219 !)
<td class="source followlines-btn-parent"><a href="#l25"> 25</a> <span class="kn">import</span> <span class="nn">sys</span></td> (no-pygments219 !)
</tr>
<tr id="l26" class="thisrev">
<td class="annotate parity0">
......@@ -1022,7 +1030,8 @@
$ cat hg.pid >> $DAEMON_PIDS
$ get-with-headers.py localhost:$HGPORT 'file/tip/unknownfile' | grep l2
<span id="l2"><span class="k">def</span> <span class="nf">foo</span><span class="p">():</span></span><a href="#l2"></a>
<span id="l2"><span class="k">def</span><span class="w"> </span><span class="nf">foo</span><span class="p">():</span></span><a href="#l2"></a> (pygments219 !)
<span id="l2"><span class="k">def</span> <span class="nf">foo</span><span class="p">():</span></span><a href="#l2"></a> (no-pygments219 !)
We can prevent Pygments from falling back to a non filename-based
detection mode
......