This patch series adds support for the new --amend option of the hg commit command.
This comes during the freeze because I had to wait for the mercurial freeze before properly testing this new feature. Nevertheless I think that we should try to support it on the next release, since 'commit --amend' is one of the top new features on mercurial 2.2.
The actual patch which adds support for --amend is the second one. The first patch simply adds an 'hgversionint' variable to the tortoisehg.util.hgversion module to make it easier to compare the current mercurial version with a given version.
In most cases one would not check the actual mercurial version, but the existence of a given capability, but in this case there is no way to tell whether the commit command supports amend other than checking the actual version number.
<angel.ezque...@gmail.com> wrote:
> This patch series adds support for the new --amend option of the hg
> commit command.
> This comes during the freeze because I had to wait for the mercurial
> freeze before properly testing this new feature. Nevertheless I think
> that we should try to support it on the next release, since 'commit
> --amend' is one of the top new features on mercurial 2.2.
> The actual patch which adds support for --amend is the second one. The
> first patch simply adds an 'hgversionint' variable to the
> tortoisehg.util.hgversion module to make it easier to compare the
> current mercurial version with a given version.
> In most cases one would not check the actual mercurial version, but
> the existence of a given capability, but in this case there is no way
> to tell whether the commit command supports amend other than checking
> the actual version number.
You should be able to check for 'amend' in the command table in
commands.py. I think we did this in other places but I couldn't find
them.
On Thu, May 3, 2012 at 6:59 AM, Steve Borho <st...@borho.org> wrote:
> On Wed, Apr 25, 2012 at 7:03 AM, Angel Ezquerra
> <angel.ezque...@gmail.com> wrote:
>> This patch series adds support for the new --amend option of the hg
>> commit command.
>> This comes during the freeze because I had to wait for the mercurial
>> freeze before properly testing this new feature. Nevertheless I think
>> that we should try to support it on the next release, since 'commit
>> --amend' is one of the top new features on mercurial 2.2.
>> The actual patch which adds support for --amend is the second one. The
>> first patch simply adds an 'hgversionint' variable to the
>> tortoisehg.util.hgversion module to make it easier to compare the
>> current mercurial version with a given version.
>> In most cases one would not check the actual mercurial version, but
>> the existence of a given capability, but in this case there is no way
>> to tell whether the commit command supports amend other than checking
>> the actual version number.
> You should be able to check for 'amend' in the command table in
> commands.py. I think we did this in other places but I couldn't find
> them.
> --
> Steve Borho
OK, I will check into that. Are you ok with the rest of the patch?
I still think it is nice to be able to check the actual mercurial
version, if only for debugging purposes. Also there may be instances
where it is just not possible or easy to check that a given capability
is available.
<angel.ezque...@gmail.com> wrote:
> On Thu, May 3, 2012 at 6:59 AM, Steve Borho <st...@borho.org> wrote:
>> On Wed, Apr 25, 2012 at 7:03 AM, Angel Ezquerra
>> <angel.ezque...@gmail.com> wrote:
>>> This patch series adds support for the new --amend option of the hg
>>> commit command.
>>> This comes during the freeze because I had to wait for the mercurial
>>> freeze before properly testing this new feature. Nevertheless I think
>>> that we should try to support it on the next release, since 'commit
>>> --amend' is one of the top new features on mercurial 2.2.
>>> The actual patch which adds support for --amend is the second one. The
>>> first patch simply adds an 'hgversionint' variable to the
>>> tortoisehg.util.hgversion module to make it easier to compare the
>>> current mercurial version with a given version.
>>> In most cases one would not check the actual mercurial version, but
>>> the existence of a given capability, but in this case there is no way
>>> to tell whether the commit command supports amend other than checking
>>> the actual version number.
>> You should be able to check for 'amend' in the command table in
>> commands.py. I think we did this in other places but I couldn't find
>> them.
>> --
>> Steve Borho
> OK, I will check into that. Are you ok with the rest of the patch?
Sure, looks fine
> I still think it is nice to be able to check the actual mercurial
> version, if only for debugging purposes. Also there may be instances
> where it is just not possible or easy to check that a given capability
> is available.
On Thu, May 3, 2012 at 7:20 AM, Steve Borho <st...@borho.org> wrote:
> On Thu, May 3, 2012 at 12:15 AM, Angel Ezquerra
> <angel.ezque...@gmail.com> wrote:
>> On Thu, May 3, 2012 at 6:59 AM, Steve Borho <st...@borho.org> wrote:
>>> On Wed, Apr 25, 2012 at 7:03 AM, Angel Ezquerra
>>> <angel.ezque...@gmail.com> wrote:
>>>> This patch series adds support for the new --amend option of the hg
>>>> commit command.
>>>> This comes during the freeze because I had to wait for the mercurial
>>>> freeze before properly testing this new feature. Nevertheless I think
>>>> that we should try to support it on the next release, since 'commit
>>>> --amend' is one of the top new features on mercurial 2.2.
>>>> The actual patch which adds support for --amend is the second one. The
>>>> first patch simply adds an 'hgversionint' variable to the
>>>> tortoisehg.util.hgversion module to make it easier to compare the
>>>> current mercurial version with a given version.
>>>> In most cases one would not check the actual mercurial version, but
>>>> the existence of a given capability, but in this case there is no way
>>>> to tell whether the commit command supports amend other than checking
>>>> the actual version number.
>>> You should be able to check for 'amend' in the command table in
>>> commands.py. I think we did this in other places but I couldn't find
>>> them.
>>> --
>>> Steve Borho
>> OK, I will check into that. Are you ok with the rest of the patch?
> Sure, looks fine
>> I still think it is nice to be able to check the actual mercurial
>> version, if only for debugging purposes. Also there may be instances
>> where it is just not possible or easy to check that a given capability
>> is available.
> understood
I looked into checking the command table to confirm that commit has an
amend option. It is possible to do, but it is more complex that I'd
like it to.
Basically, you can do:
from mercurial import commands
commitopts = commands.table['^commit|ci']
canamend = False
for opt in commitopts:
if opt[1] == 'amend':
canamend = True
break
This seems a bit complex compared to just checking the version number.
Is it worth it?
<angel.ezque...@gmail.com> wrote:
> On Thu, May 3, 2012 at 7:20 AM, Steve Borho <st...@borho.org> wrote:
>> On Thu, May 3, 2012 at 12:15 AM, Angel Ezquerra
>> <angel.ezque...@gmail.com> wrote:
>>> On Thu, May 3, 2012 at 6:59 AM, Steve Borho <st...@borho.org> wrote:
>>>> On Wed, Apr 25, 2012 at 7:03 AM, Angel Ezquerra
>>>> <angel.ezque...@gmail.com> wrote:
>>>>> This patch series adds support for the new --amend option of the hg
>>>>> commit command.
>>>>> This comes during the freeze because I had to wait for the mercurial
>>>>> freeze before properly testing this new feature. Nevertheless I think
>>>>> that we should try to support it on the next release, since 'commit
>>>>> --amend' is one of the top new features on mercurial 2.2.
>>>>> The actual patch which adds support for --amend is the second one. The
>>>>> first patch simply adds an 'hgversionint' variable to the
>>>>> tortoisehg.util.hgversion module to make it easier to compare the
>>>>> current mercurial version with a given version.
>>>>> In most cases one would not check the actual mercurial version, but
>>>>> the existence of a given capability, but in this case there is no way
>>>>> to tell whether the commit command supports amend other than checking
>>>>> the actual version number.
>>>> You should be able to check for 'amend' in the command table in
>>>> commands.py. I think we did this in other places but I couldn't find
>>>> them.
>>>> --
>>>> Steve Borho
>>> OK, I will check into that. Are you ok with the rest of the patch?
>> Sure, looks fine
>>> I still think it is nice to be able to check the actual mercurial
>>> version, if only for debugging purposes. Also there may be instances
>>> where it is just not possible or easy to check that a given capability
>>> is available.
>> understood
> I looked into checking the command table to confirm that commit has an
> amend option. It is possible to do, but it is more complex that I'd
> like it to.
> Basically, you can do:
> from mercurial import commands
> commitopts = commands.table['^commit|ci']
> canamend = False
> for opt in commitopts:
> if opt[1] == 'amend':
> canamend = True
> break
> This seems a bit complex compared to just checking the version number.
> Is it worth it?
I'm fine with a version number check, so long as it's short lived.
On Thu, May 3, 2012 at 7:51 AM, Steve Borho <st...@borho.org> wrote:
> On Thu, May 3, 2012 at 12:37 AM, Angel Ezquerra
> <angel.ezque...@gmail.com> wrote:
>> On Thu, May 3, 2012 at 7:20 AM, Steve Borho <st...@borho.org> wrote:
>>> On Thu, May 3, 2012 at 12:15 AM, Angel Ezquerra
>>> <angel.ezque...@gmail.com> wrote:
>>>> On Thu, May 3, 2012 at 6:59 AM, Steve Borho <st...@borho.org> wrote:
>>>>> On Wed, Apr 25, 2012 at 7:03 AM, Angel Ezquerra
>>>>> <angel.ezque...@gmail.com> wrote:
>>>>>> This patch series adds support for the new --amend option of the hg
>>>>>> commit command.
>>>>>> This comes during the freeze because I had to wait for the mercurial
>>>>>> freeze before properly testing this new feature. Nevertheless I think
>>>>>> that we should try to support it on the next release, since 'commit
>>>>>> --amend' is one of the top new features on mercurial 2.2.
>>>>>> The actual patch which adds support for --amend is the second one. The
>>>>>> first patch simply adds an 'hgversionint' variable to the
>>>>>> tortoisehg.util.hgversion module to make it easier to compare the
>>>>>> current mercurial version with a given version.
>>>>>> In most cases one would not check the actual mercurial version, but
>>>>>> the existence of a given capability, but in this case there is no way
>>>>>> to tell whether the commit command supports amend other than checking
>>>>>> the actual version number.
>>>>> You should be able to check for 'amend' in the command table in
>>>>> commands.py. I think we did this in other places but I couldn't find
>>>>> them.
>>>>> --
>>>>> Steve Borho
>>>> OK, I will check into that. Are you ok with the rest of the patch?
>>> Sure, looks fine
>>>> I still think it is nice to be able to check the actual mercurial
>>>> version, if only for debugging purposes. Also there may be instances
>>>> where it is just not possible or easy to check that a given capability
>>>> is available.
>>> understood
>> I looked into checking the command table to confirm that commit has an
>> amend option. It is possible to do, but it is more complex that I'd
>> like it to.
>> Basically, you can do:
>> from mercurial import commands
>> commitopts = commands.table['^commit|ci']
>> canamend = False
>> for opt in commitopts:
>> if opt[1] == 'amend':
>> canamend = True
>> break
>> This seems a bit complex compared to just checking the version number.
>> Is it worth it?
> I'm fine with a version number check, so long as it's short lived.
> --
> Steve Borho
We usually only support the latest 2 mercurial versions, don't we? We
could make it a point to always remove any check for older releases
after every full release.