Mercurial > public > mercurial-scm > hg
changeset 53037:a232522d3770 default
branching: merge with stable
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Tue, 11 Mar 2025 04:15:39 +0100 |
parents | d81714a1c88d (current diff) 6e1eb7212633 (diff) |
children | |
files | |
diffstat | 7 files changed, 86 insertions(+), 14 deletions(-) [+] |
line wrap: on
line diff
--- a/contrib/heptapod-ci.yml Thu Mar 06 09:44:13 2025 +0100 +++ b/contrib/heptapod-ci.yml Tue Mar 11 04:15:39 2025 +0100 @@ -702,5 +702,6 @@ upload --verbose --repository-url ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/pypi + --skip-existing wheels/*/*/*/*.whl wheels/*/*.whl
--- a/hgext/clonebundles.py Thu Mar 06 09:44:13 2025 +0100 +++ b/hgext/clonebundles.py Tue Mar 11 04:15:39 2025 +0100 @@ -1029,8 +1029,10 @@ 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) - 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
--- a/mercurial/configitems.toml Thu Mar 06 09:44:13 2025 +0100 +++ b/mercurial/configitems.toml Tue Mar 11 04:15:39 2025 +0100 @@ -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
--- a/mercurial/utils/procutil.py Thu Mar 06 09:44:13 2025 +0100 +++ b/mercurial/utils/procutil.py Tue Mar 11 04:15:39 2025 +0100 @@ -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
--- a/tests/hghave.py Thu Mar 06 09:44:13 2025 +0100 +++ b/tests/hghave.py Tue Mar 11 04:15:39 2025 +0100 @@ -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))
--- a/tests/test-clonebundles-autogen.t Thu Mar 06 09:44:13 2025 +0100 +++ b/tests/test-clonebundles-autogen.t Tue Mar 11 04:15:39 2025 +0100 @@ -411,12 +411,61 @@ 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 - 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]
--- a/tests/test-highlight.t Thu Mar 06 09:44:13 2025 +0100 +++ b/tests/test-highlight.t Tue Mar 11 04:15:39 2025 +0100 @@ -160,12 +160,15 @@ <span id="l4"><span class="sd"> where sieve (p:ns) = p : sieve [n | n <- ns, mod n p /= 0]</span></span><a href="#l4"></a> <span id="l5"><span class="sd">"""</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> - <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">"""Generate all primes."""</span></span><a href="#l10"></a> (pygments214 !) <span id="l10"> <span class="sd">"""Generate all primes."""</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"><</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">"__main__"</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