https://www.redmine.org/https://www.redmine.org/favicon.ico?16793021292008-05-20T17:14:46ZRedmineRedmine - Patch #1199: Mercurial adapterhttps://www.redmine.org/issues/1199?journal_id=28452008-05-20T17:14:46ZPierre Paysant-Le Roux
<ul><li><strong>File</strong> <a href="/attachments/542">redmine-patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/542/redmine-patch">redmine-patch</a> added</li></ul><p>This new version of the patch resolves issue <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Defect: Mercurial : Don't browse latest version after a 'hg push' (Closed)" href="https://www.redmine.org/issues/1241">#1241</a>.</p> Redmine - Patch #1199: Mercurial adapterhttps://www.redmine.org/issues/1199?journal_id=28782008-05-21T10:04:18ZFrédéric Moulins
<ul><li><strong>File</strong> <a href="/attachments/548">patch-1199_against_r1441.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/548/patch-1199_against_r1441.patch">patch-1199_against_r1441.patch</a> added</li></ul><p>Hello,</p>
<p>thanks for the solution !</p>
Your patch didn't applied cleanly, there was a problem with hunk 2 of mercurial_adapter.rb.<br />Here is your patch with a few modifications :
<ul>
<li>use of <code>to_s</code> in <code>cmd << " -r " + (identifier ? identifier.to_s : "tip")</code> (I think this line caused your patch to not apply).</li>
<li>use of the same trick for cat and annotate, to be able to see files at a specific revision.</li>
</ul>
<p>I tested on a Linux machine with Mercurial 1.0.<br />Could you test it again with both versions of Mercurial and on Windows ?</p>
<p>Patch apply to <a class="changeset" title="Use display: block; for activity item descriptions." href="https://www.redmine.org/projects/redmine/repository/svn/revisions/1441">r1441</a> and also to <a class="changeset" title="Fix comment about configuration." href="https://www.redmine.org/projects/redmine/repository/svn/revisions/1420">r1420</a>.</p> Redmine - Patch #1199: Mercurial adapterhttps://www.redmine.org/issues/1199?journal_id=30372008-05-29T18:28:25ZJean-Philippe Langjp_lang@yahoo.fr
<ul></ul><p>This patch applies cleanly on the latest code. But it breaks this unit test: <code>test_fetch_changesets_from_scratch(RepositoryMercurialTest)</code>.<br />It looks like the commit message is truncated to the first line. I'm running hg 1.0 on win32.<br />Any idea?</p>
<p>Also I think that <code>MercurialAdapter.template_path</code> is not accurate.<br />Here is my output of hg --version:</p>
<pre>
Mercurial Distributed SCM (version 1e4ddc9ac9f7+20080325)
Copyright (C) 2005-2008 Matt Mackall <mpm@selenic.com> and others
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
</pre>
<p>Maybe we could choose the 1.0 template if it doesn't match something like: <code>/version (\d+(\.\d+)*)/</code> ?</p> Redmine - Patch #1199: Mercurial adapterhttps://www.redmine.org/issues/1199?journal_id=30442008-05-30T06:05:41ZPaul Rivier
<ul></ul><p>here is my output for hg --version. First is for .9.5, second is for 1.0. System is debianish, .9.5 is provided by distro repository, 1.0 is built from hg sources.</p>
<pre> Mercurial Distributed SCM (version 0.9.5)</pre><br /><pre> Mercurial Distributed SCM (version 1.0)</pre>
<p>Jean Philippe, how did you get your copy of HG ?</p>
<p>By the way, a fallback as suggested is probably safe.</p> Redmine - Patch #1199: Mercurial adapterhttps://www.redmine.org/issues/1199?journal_id=30462008-05-30T08:34:55ZPierre Paysant-Le Roux
<ul></ul><p>The binary package of Mercurial for Windows is built from a snapshot and not from an official release. As a result, the version number provided by hg --version is the revision id of the compiled source.</p> Redmine - Patch #1199: Mercurial adapterhttps://www.redmine.org/issues/1199?journal_id=30532008-05-30T14:24:17ZPierre Paysant-Le Roux
<ul><li><strong>File</strong> <a href="/attachments/582">patch-redmine-mercurial.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/582/patch-redmine-mercurial.patch">patch-redmine-mercurial.patch</a> added</li></ul><p>Here is a new patch that passes unit tests. In fact, all the commit messages where truncated.</p>
<p>Is there a way to obtain the repositories used for unit testing ?</p>
<p>I modified the behaviour for the template selection. If the version number is not a version number (ie it's not an official release), then the template1.0 is used. I asked the Mercurial packager for Windows why he don't use official releases.</p> Redmine - Patch #1199: Mercurial adapterhttps://www.redmine.org/issues/1199?journal_id=30942008-06-02T18:00:25ZJean-Philippe Langjp_lang@yahoo.fr
<ul></ul><p>Pierre, the repository used for unit and functionnal tests can be found in <code>test/fixtures/repositories</code>.<br />Extract it into <code>tmp/test</code> as documented in <a class="source" href="https://www.redmine.org/projects/redmine/repository/svn/entry/trunk/doc/RUNNING_TESTS">source:/trunk/doc/RUNNING_TESTS</a> :</p>
<pre><code>gunzip < test/fixtures/repositories/mercurial_repository.tar.gz | tar -xv -C tmp/test</code></pre>
<p>I did not do a full review of your patch but tests are OK. Do you think it's ready for commit ?</p> Redmine - Patch #1199: Mercurial adapterhttps://www.redmine.org/issues/1199?journal_id=31032008-06-03T18:01:50ZPierre Paysant-Le Roux
<ul><li><strong>File</strong> <a href="/attachments/600">patch-mercurial-adapter.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/600/patch-mercurial-adapter.patch">patch-mercurial-adapter.patch</a> added</li></ul><p>I made a new patch with a bit more unit tests. I think it can be commited now. The piece of code is in use for some days in our Redmine instance.</p> Redmine - Patch #1199: Mercurial adapterhttps://www.redmine.org/issues/1199?journal_id=31922008-06-07T09:20:15ZJean-Philippe Langjp_lang@yahoo.fr
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>Closed</i></li><li><strong>Target version</strong> set to <i>0.8</i></li></ul><p>Patch committed in <a class="changeset" title="Mercurial adapter improvements (patch #1199 by Pierre Paysant-Le Roux)." href="https://www.redmine.org/projects/redmine/repository/svn/revisions/1499">r1499</a>.<br />I made a small change in order to move the templates from <code>/extra</code> to <code>/lib/redmine/scm/adapters/mercurial</code> since the adapter depends on these files.<br />Thanks for your work.</p>