[PATCH 2 of 2] summary: don't indicate a clean wdir() with deleted files (issue5549)

Matt Harbison mharbison72 at gmail.com
Mon Jul 3 22:30:34 EDT 2017


On Mon, 03 Jul 2017 09:59:38 -0400, Yuya Nishihara <yuya at tcha.org> wrote:

> On Sun, 02 Jul 2017 22:50:21 -0400, Matt Harbison wrote:
>> # HG changeset patch
>> # User Matt Harbison <matt_harbison at yahoo.com>
>> # Date 1498705338 14400
>> #      Wed Jun 28 23:02:18 2017 -0400
>> # Node ID fcbab9a85517f363a9c0bdfa80362b88843258ac
>> # Parent  0fcbcb681899ad44a33380788750ea375aa70864
>> summary: don't indicate a clean wdir() with deleted files (issue5549)
>>
>> It wasn't a BC when copy/rename was added (997ab9af81df), or when  
>> subrepos were
>> added (c4347e48b0d0).
>
> (This changes the existing behavior, so should be marked as BC, I think.)
>
>>
>> diff --git a/mercurial/commands.py b/mercurial/commands.py
>> --- a/mercurial/commands.py
>> +++ b/mercurial/commands.py
>> @@ -4870,8 +4870,8 @@
>>      elif (parents[0].closesbranch() and
>>            pnode in repo.branchheads(branch, closed=True)):
>>          t += _(' (head closed)')
>> -    elif not (status.modified or status.added or status.removed or  
>> renamed or
>> -              copied or subs):
>> +    elif not (status.modified or status.added or status.removed or
>> +              status.deleted or renamed or copied or subs):
>>          t += _(' (clean)')
>>          cleanworkdir = True
>
> This seemed better to me, but I guess the original intent was to show  
> whether
> new commit could be made (=not clean) or not (=clean).
>
>> @@ -35,7 +35,7 @@
>>    parent: 3:cb66ec850af7 tip
>>     add b
>>    branch: default
>> -  commit: 1 deleted (clean)
>> +  commit: 1 deleted
>
> Probably that's why this field is called "commit".
>
> Thoughts?

Yeah, I kind of wondered if that's what was going on, and why I went back  
and forth on it for the last 2.5 years.  It came up when writing the  
training for new developers, and people understandably associated "clean  
working directory" with this line.

I'm fine with making the presence of '+' in `hg identify` output be the  
way to tell dirty or not, as long as '!' in a subrepo triggers a '+' on  
the top level repo.  (Though it seems like there could be an explicit line  
and text in `hg summary` too.)  Maybe to alleviate the confusion, change  
'clean' here to 'uncommittable'?  Or 'nothing', to be less scary?  (Though  
at that point we've broken anything parsing it, so IDK if slightly  
changing the meaning matters too much.)

I also think that the --check flag needs to be fixed up too.


More information about the Mercurial-devel mailing list