Re: [Python-Dev] Generating patch files
I get unknown revision (listing the full expression text) when using Mercurial 1.6.3 (default version in Ubuntu 10.10). Based on Baptiste's approach, I propose the script below to compute a patch. Please report whether it works for you. Regards, Martin #!/bin/sh base=`hg log --template {rev} -r'max(ancestors(default)-outgoing())'` hg diff -r$base ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] Generating patch files
Le 16/03/2011 18:49, Martin v. Löwis a écrit : Having the revision of cpython to compare against is the difficult part; how about: 'max( ancestors(default) and not outgoing() )' ? ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] Generating patch files
Am 17.03.11 07:30, schrieb Baptiste Carvello: Le 16/03/2011 18:49, Martin v. Löwis a écrit : Having the revision of cpython to compare against is the difficult part; how about: 'max( ancestors(default) and not outgoing() )' ? That fails if there have been later merges with default. Regards, Martin ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] Generating patch files
Am 17.03.11 07:30, schrieb Baptiste Carvello: Le 16/03/2011 18:49, Martin v. Löwis a écrit : Having the revision of cpython to compare against is the difficult part; how about: 'max( ancestors(default) and not outgoing() )' ? I take back what I just said: it looks good. Regards, Martin ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
[Python-Dev] Generating patch files
I think I figured out how to generate a single patch for a clone that has all its changes on the default branch, comparing it with cpython's default branch. The command to generate the patch is hg diff -r'max(p1(min(outgoing())) or p2(max(merge() and branch(default' -r default If it's a branch different from default, replace 'default' in both places with the branch name. I'd be curious for people to try this out and report whether it works correctly. You'll need a Mercurial release supporting revsets. Here is the theory of operation: The diff needs to be either from the oldest of the commits (in case no merges have been made from cpython), or from cpython's code in that was last merged. So: - merge() gives all changesets that are merges - branch(default) gives all changesets on the default branch - 'merge() and branch(default)' gives all merges to the default branch - max(merge() and branch(default)) gives the most recent merge to the default branch - p2(max(merge() and branch(default))) is the second parent, which will be the upstream version of cpython that got last merged - outgoing() gives all changes in the local repository not in cpython - min(outgoing()) gives the first local change made - p1(min(outgoing())) gives revision that was the starting point for the local modifications - max(p1(...) or p2(...)) determines which of the two is later. Having the revision of cpython to compare against is the difficult part; the other revision must be default's head, which is always called 'default'. Enjoy, Martin ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] Generating patch files
On Wed, Mar 16, 2011 at 1:49 PM, Martin v. Löwis mar...@v.loewis.de wrote: I think I figured out how to generate a single patch for a clone that has all its changes on the default branch, comparing it with cpython's default branch. The command to generate the patch is hg diff -r'max(p1(min(outgoing())) or p2(max(merge() and branch(default' -r default If it's a branch different from default, replace 'default' in both places with the branch name. I'd be curious for people to try this out and report whether it works correctly. You'll need a Mercurial release supporting revsets. I get unknown revision (listing the full expression text) when using Mercurial 1.6.3 (default version in Ubuntu 10.10). That version apparently supports revsets, but I'm not sure when the runtime evaluation of the command line arguments was added. Cheers, Nick. -- Nick Coghlan | ncogh...@gmail.com | Brisbane, Australia ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] Generating patch files
I get unknown revision (listing the full expression text) when using Mercurial 1.6.3 (default version in Ubuntu 10.10). That version apparently supports revsets, but I'm not sure when the runtime evaluation of the command line arguments was added. Apparently shortly after Debian/Ubuntu included the release; I think I had the same issue with 1.6.4. Regards, Martin ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] Generating patch files
Am 16.03.11 15:20, schrieb Martin v. Löwis: I get unknown revision (listing the full expression text) when using Mercurial 1.6.3 (default version in Ubuntu 10.10). That version apparently supports revsets, but I'm not sure when the runtime evaluation of the command line arguments was added. Apparently shortly after Debian/Ubuntu included the release; I think I had the same issue with 1.6.4. Before you upgrade: give me some time to come up with a script that uses Mercurial API instead to compute the revset and then invoke the diff command. We must get something out of using a Python-based DVCS... Regards, Martin ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] Generating patch files
In article 4d810f84.5060...@v.loewis.de, Martin v. Löwis mar...@v.loewis.de wrote: Before you upgrade: give me some time to come up with a script that uses Mercurial API instead to compute the revset and then invoke the diff command. We must get something out of using a Python-based DVCS... Note the Mercurial project warns that use of the Mercurial API 'is a strong indication that you're creating a derived work subject to the GPL.' http://mercurial.selenic.com/wiki/MercurialApi http://mercurial.selenic.com/wiki/License Would distributing a script that called the API in any way taint Python? -- Ned Deily, n...@acm.org ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] Generating patch files
Note the Mercurial project warns that use of the Mercurial API 'is a strong indication that you're creating a derived work subject to the GPL.' http://mercurial.selenic.com/wiki/MercurialApi http://mercurial.selenic.com/wiki/License Would distributing a script that called the API in any way taint Python? Perhaps. So I'll see whether I can make use of the command line only, first. Regards, Martin ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] Generating patch files
On Thu, Mar 17, 2011 at 5:00 AM, Ned Deily n...@acm.org wrote: In article 4d810f84.5060...@v.loewis.de, Martin v. Löwis mar...@v.loewis.de wrote: Before you upgrade: give me some time to come up with a script that uses Mercurial API instead to compute the revset and then invoke the diff command. We must get something out of using a Python-based DVCS... Note the Mercurial project warns that use of the Mercurial API 'is a strong indication that you're creating a derived work subject to the GPL.' Would distributing a script that called the API in any way taint Python? Yes, if used to build or run Python. No, if used to develop Python. ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] Generating patch files
Am 16.03.11 15:29, schrieb Martin v. Löwis: Am 16.03.11 15:20, schrieb Martin v. Löwis: I get unknown revision (listing the full expression text) when using Mercurial 1.6.3 (default version in Ubuntu 10.10). That version apparently supports revsets, but I'm not sure when the runtime evaluation of the command line arguments was added. Apparently shortly after Debian/Ubuntu included the release; I think I had the same issue with 1.6.4. Before you upgrade: give me some time to come up with a script that uses Mercurial API instead to compute the revset and then invoke the diff command. It turns out that 1.6 doesn't have the min() revset function, so I give up on that - the recipe can only work in 1.7 and later. Regards, Martin ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] Generating patch files
On Wed, 16 Mar 2011 20:47:10 -0400, =?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?= mar...@v.loewis.de wrote: Note the Mercurial project warns that use of the Mercurial API 'is a strong indication that you're creating a derived work subject to the GPL.' http://mercurial.selenic.com/wiki/MercurialApi http://mercurial.selenic.com/wiki/License Would distributing a script that called the API in any way taint Python? Perhaps. So I'll see whether I can make use of the command line only, first. As long as we aren't distributing mercurial itself, I don't see how a script could be a problem. But, then, IANAL. -- R. David Murray www.bitdance.com ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] Generating patch files
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 16/03/11 20:29, Martin v. Löwis wrote: Before you upgrade: give me some time to come up with a script that uses Mercurial API instead to compute the revset and then invoke the diff command. We must get something out of using a Python-based DVCS... Beware, mercurial API is not stable. That is, it can change anytime. Paradoxically, the stable API is the commandline, IIRC. - -- Jesus Cea Avion _/_/ _/_/_/_/_/_/ j...@jcea.es - http://www.jcea.es/ _/_/_/_/ _/_/_/_/ _/_/ jabber / xmpp:j...@jabber.org _/_/_/_/ _/_/_/_/_/ . _/_/ _/_/_/_/ _/_/ _/_/ Things are not so easy _/_/ _/_/_/_/ _/_/_/_/ _/_/ My name is Dump, Core Dump _/_/_/_/_/_/ _/_/ _/_/ El amor es poner tu felicidad en la felicidad de otro - Leibniz -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQCVAwUBTYGKsZlgi5GaxT1NAQLEegP9GlKeCi5FRICOXUe2gjQbEWQ3lI44V3ae +XjGf1FqS5kWgGLM+DlpHZuOB8pQo80ZZFpxOY3MzVi/SCBm8i+SfjGDdS9QQS7X Y6i7duZ7ubbHls6hnN9weHB6MXBCA+GQQQg8oMSnGiUdXLLBkUzhY+/pXb688wpE dxFneCjN6W8= =Xpds -END PGP SIGNATURE- ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com