Re: Mercurial 5.4 Sprint; Paris, France; March 27th-29th.

2020-03-13 Thread Pierre-Yves David

Hello again,

TL;DR: The end of March sprint is cancelled. It will be rescheduled once 
the pandemic settled down.


Given he current trend and the restriction already in place. We have to 
cancel the current sprint plan.


Avoiding extra mixing of people is the responsible things to do at this 
point. In addition, Most oversee attended have cancelled, France is 
setting strong restriction and the Mozilla office will be closed.


Once travel will be an option again, we will reschedule a European based 
sprint. In the meantime, we might try and schedule some video session to 
discuss some important topic.


Cheers,

On 3/2/20 5:33 PM, Pierre-Yves David wrote:

Hello everyone

Unfortunately with the covid-19 crisis escalating world-wide we might 
need to change plan…


France is getting its first restriction measure, for now this is only 
about events over 5 000 people, but I would not be surprised if further 
measure are taken in the coming weeks.


In addition, Augie Fackler also just informed me that Google suspended 
all international travel, effectively cancelling their ability to attend.


So we might have to downscale this to a more local event, delay it later 
this year or any suitable options.


So hold your travel plan on until we figure this out.

Cheers,

On 2/14/20 8:23 AM, Pierre-Yves David wrote:

Hi everyone,

This is a reminder that we have a Community sprint coming. It will be 
held in Paris, France from Friday March 27th to Sunday 29th 2020.


Everyone is welcome from core developers to aspiring contributors. 
Attending a Mercurial sprint is usually a good way to kickstart your 
contributions as you'll get a large amount of help available for 3 days.


The sprint will be hosted by:

   Mozilla Paris
   117/119 quai de Valmy,
   Paris 75010,
   France

Some travel sponsoring will be available, reach out to us if you need 
some. Likewise, reach out to use if you need some paper work for 
immigration purpose.


See you in Paris.





--
Pierre-Yves David
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D8280: tests: make test-doctest.t module list match reality

2020-03-13 Thread marmoute (Pierre-Yves David)
marmoute added a comment.


  Should we try to move to some automatic detection of file with doctest? That 
would be more reliable.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8280/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8280

To: spectral, #hg-reviewers, mharbison72
Cc: marmoute, mharbison72, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D8282: tests: consistently put #testcases at beginning of file

2020-03-13 Thread marmoute (Pierre-Yves David)
marmoute added a comment.


  The other change looks good and I would take them if they were not in the 
same changeset as the change in tests/test-push-race.t

INLINE COMMENTS

> test-push-race.t:1-3
> +#testcases strict unrelated
> +
>  
> 

Please avoir putting content before the test file title.
(and maybe keep the documentation closer to them.)

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8282/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8282

To: martinvonz, durin42, #hg-reviewers
Cc: marmoute, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D8281: narrow: escape includepats/excludepats when sending over the wire (BC)

2020-03-13 Thread marmoute (Pierre-Yves David)
This revision now requires changes to proceed.
marmoute added a comment.
marmoute requested changes to this revision.


  The escaping scheme is a bit puzzling to me. Coudl we use something more 
standard for this ? (like urlencode).
  
  (requesting change of the function name. Now that we can, lets make them 
readable)

INLINE COMMENTS

> wireprototypes.py:183
>  
> +def encodecsvpaths(paths):
> +r'''escape and join a value of type 'csvpaths', producing a bytes object

Let's name it `encode_csv_paths` now that `_` are permitted. It woul dbe easier 
to read.

> wireprototypes.py:220
> +
> +def decodecsvpaths(s):
> +r'''decode an value of type 'csvpaths', producing a list

Let's name it `decode_csv_paths` now that `_` are permitted. It woul dbe easier 
to read.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8281/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8281

To: spectral, durin42, martinvonz, #hg-reviewers, marmoute
Cc: marmoute, mharbison72, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D8282: tests: consistently put #testcases at beginning of file

2020-03-13 Thread martinvonz (Martin von Zweigbergk)
martinvonz added inline comments.

INLINE COMMENTS

> marmoute wrote in test-push-race.t:1-3
> Please avoir putting content before the test file title.
> (and maybe keep the documentation closer to them.)

> Please avoir putting content before the
> test file title.

Why? (I personally don't find this hard to read.)

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8282/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8282

To: martinvonz, durin42, #hg-reviewers, marmoute
Cc: marmoute, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D8282: tests: consistently put #testcases at beginning of file

2020-03-13 Thread mharbison72 (Matt Harbison)
mharbison72 added inline comments.
mharbison72 accepted this revision.

INLINE COMMENTS

> martinvonz wrote in test-push-race.t:1-3
> > Please avoir putting content before the
> > test file title.
> 
> Why? (I personally don't find this hard to read.)

I'd go further and say it's easier to read when `#testcases` is the very first 
line, as it doesn't get visually swallowed by nesting between two long lines.  
(I didn't realize they didn't have to be the first line, and wouldn't have 
looked anywhere else either.)

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8282/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8282

To: martinvonz, durin42, #hg-reviewers, marmoute, mharbison72
Cc: mharbison72, marmoute, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D8281: narrow: escape includepats/excludepats when sending over the wire (BC)

2020-03-13 Thread mharbison72 (Matt Harbison)
mharbison72 added a comment.


  In D8281#123625 , @spectral 
wrote:
  
  > In D8281#123621 , @mharbison72 
wrote:
  >
  >> The Windows path changes seem like a good idea.
  >> Would quoting paths with commas eliminate the need for custom escaping?  I 
don't feel strongly about it, but custom escaping always feels weird to me.  (I 
fact, a coworker did some homebrew escaping for CSV files a few days ago, but I 
forget how it ultimately ended up.)
  >
  > Let me play with that a bit, I think it'll work and be detectable on the 
server since the first character can't currently be a double-quote, so there 
wouldn't really be any BC issues aside from the pconvert (which wouldn't be as 
important anymore, but still probably a good idea?)
  
  I haven't played with narrow yet, so I'm not sure of the context.  Are these 
user input paths that would end up being ignored/rejected if a Windows user 
used `path\to\file` when talking to a Unix server?  Or are these stored in a 
tracked file? (Which I think could still cause problems.)  I can't think of a 
good reason to stay inconsistent, and it is still experimental, so it still 
seems like a good idea while we still can fix it.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8281/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8281

To: spectral, durin42, martinvonz, #hg-reviewers, marmoute
Cc: marmoute, mharbison72, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D8282: tests: consistently put #testcases at beginning of file

2020-03-13 Thread marmoute (Pierre-Yves David)
marmoute added a comment.


  I would rather have the large title (===\ntitle\n===) be the very first 
things in the test for clarify.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8282/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8282

To: martinvonz, durin42, #hg-reviewers, marmoute, mharbison72
Cc: mharbison72, marmoute, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D8282: tests: consistently put #testcases at beginning of file

2020-03-13 Thread martinvonz (Martin von Zweigbergk)
martinvonz added a comment.


  I very much agree with Matt
  
  In D8282#123660 , @marmoute 
wrote:
  
  > I would rather have the large title (===\ntitle\n===) be the very first 
things in the test for clarify.
  
  I'm like @mharbison72 and mostly skip past the #testcases and #requires at 
the top (like imports and includes in other languages), so they don't bother me 
at all. Sounds like we have two votes in favor and one against. Let's see what 
others feel.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8282/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8282

To: martinvonz, durin42, #hg-reviewers, marmoute, mharbison72
Cc: mharbison72, marmoute, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D8281: narrow: escape includepats/excludepats when sending over the wire (BC)

2020-03-13 Thread martinvonz (Martin von Zweigbergk)
martinvonz added a comment.


  In D8281#123659 , @mharbison72 
wrote:
  
  > In D8281#123625 , @spectral 
wrote:
  >
  >> In D8281#123621 , 
@mharbison72 wrote:
  >>
  >>> The Windows path changes seem like a good idea.
  >>> Would quoting paths with commas eliminate the need for custom escaping?  
I don't feel strongly about it, but custom escaping always feels weird to me.  
(I fact, a coworker did some homebrew escaping for CSV files a few days ago, 
but I forget how it ultimately ended up.)
  >>
  >> Let me play with that a bit, I think it'll work and be detectable on the 
server since the first character can't currently be a double-quote, so there 
wouldn't really be any BC issues aside from the pconvert (which wouldn't be as 
important anymore, but still probably a good idea?)
  >
  > I haven't played with narrow yet, so I'm not sure of the context.  Are 
these user input paths that would end up being ignored/rejected if a Windows 
user used `path\to\file` when talking to a Unix server?  Or are these stored in 
a tracked file? (Which I think could still cause problems.)  I can't think of a 
good reason to stay inconsistent, and it is still experimental, so it still 
seems like a good idea while we still can fix it.
  
  They are stored in .hg/store/narrowspec. They usually get into that file via 
`hg clone --narrow --include` and similar, but the server may also send them. 
We should ideally do the conversion early when the user provides them. I think 
the pconvert in this patch is to handle existing repos as well as possible.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8281/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8281

To: spectral, durin42, martinvonz, #hg-reviewers, marmoute
Cc: marmoute, mharbison72, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D8282: tests: consistently put #testcases at beginning of file

2020-03-13 Thread marmoute (Pierre-Yves David)
marmoute added a comment.


  In D8282#123661 , @martinvonz 
wrote:
  
  > (like imports and includes in other languages)
  
  Precisely, import and includes usually comes **after** the initial module 
licence, title and documentation. So I would like the testcase declaration to 
comes after the initial module title (and maybe doc).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8282/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8282

To: martinvonz, durin42, #hg-reviewers, marmoute, mharbison72
Cc: mharbison72, marmoute, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D8282: tests: consistently put #testcases at beginning of file

2020-03-13 Thread martinvonz (Martin von Zweigbergk)
martinvonz added a comment.


  In D8282#123663 , @marmoute 
wrote:
  
  > In D8282#123661 , @martinvonz 
wrote:
  >
  >> (like imports and includes in other languages)
  >
  > Precisely, import and includes usually comes **after** the initial module 
licence, title and documentation. So I would like the testcase declaration to 
comes after the initial module title (and maybe doc).
  
  That's fair. I assume we should do the same with `#require` in that case? 
That'll be quite a bit larger, I think (because I think we usually put them 
before the test description).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8282/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8282

To: martinvonz, durin42, #hg-reviewers, marmoute, mharbison72
Cc: mharbison72, marmoute, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D8282: tests: consistently put #testcases at beginning of file

2020-03-13 Thread marmoute (Pierre-Yves David)
marmoute added a comment.


  That's a good point, doing it for `#require` too would be more consistent.
  
  I would make a difference between test that do not make too much of an effort 
to have a title + early documentation and the one who actually make effort to 
have a formal format for their title and documentation (the one with 
`=\ntitle\n=` or `title\n=`).
  
  I would be fine with having the requires/testcases right after the title when 
it make senses. I think there are some instance where the variants are formally 
documented, and the `#testcase` block is part of that. It might make sense to 
keep them at that location.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8282/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8282

To: martinvonz, durin42, #hg-reviewers, marmoute, mharbison72
Cc: mharbison72, marmoute, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D8232: phabricator: add a helper function to convert DREVSPECs to a DREV dict list

2020-03-13 Thread Raphaël Gomès
Alphare added a comment.


  This seems like something that can easily have a few simple unit tests

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8232/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8232

To: mharbison72, #hg-reviewers
Cc: Alphare, Kwan, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D8282: tests: consistently put #testcases at beginning of file

2020-03-13 Thread martinvonz (Martin von Zweigbergk)
martinvonz added a comment.


  In D8282#123665 , @marmoute 
wrote:
  
  > That's a good point, doing it for `#require` too would be more consistent.
  > I would make a difference between test that do not make too much of an 
effort to have a title + early documentation and the one who actually make 
effort to have a formal format for their title and documentation (the one with 
`=\ntitle\n=` or `title\n=`).
  > I would be fine with having the requires/testcases right after the title 
when it make senses. I think there are some instance where the variants are 
formally documented, and the `#testcase` block is part of that. It might make 
sense to keep them at that location.
  
  I'll leave this patch as is and leave the moving of comments above 
`#testcase` and `#requires` for you to do in a follow-up (if you care enough 
about it; I still prefer having the all these `#` statements at the top).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8282/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8282

To: martinvonz, durin42, #hg-reviewers, marmoute, mharbison72
Cc: mharbison72, marmoute, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D8282: tests: consistently put #testcases at beginning of file

2020-03-13 Thread marmoute (Pierre-Yves David)
marmoute added a comment.


  Can you drop your change to `tests/test-push-race.t` from this patch ?

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8282/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8282

To: martinvonz, durin42, #hg-reviewers, marmoute, mharbison72
Cc: mharbison72, marmoute, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D8282: tests: consistently put #testcases at beginning of file

2020-03-13 Thread martinvonz (Martin von Zweigbergk)
martinvonz added a comment.


  In D8282#123675 , @marmoute 
wrote:
  
  > Can you drop your change to `tests/test-push-race.t` from this patch ?
  
  That change is consistent with the other changes in putting `#requires` and 
`#testcases` first. I'll update the commit message.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8282/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8282

To: martinvonz, durin42, #hg-reviewers, marmoute, mharbison72
Cc: mharbison72, marmoute, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D8282: tests: consistently put #testcases at beginning of file

2020-03-13 Thread marmoute (Pierre-Yves David)
marmoute added a comment.


  In D8282#123677 , @martinvonz 
wrote:
  
  > In D8282#123675 , @marmoute 
wrote:
  >
  >> Can you drop your change to `tests/test-push-race.t` from this patch ?
  >
  > That change is consistent with the other changes in putting `#requires` and 
`#testcases` first. I'll update the commit message.
  
  This change break the formatting of an otherwhise well formatted file 
(`tests/test-narrow-sparse.t`). Can you please drop it from this diff and move 
forward with the others?

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8282/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8282

To: martinvonz, durin42, #hg-reviewers, marmoute, mharbison72
Cc: mharbison72, marmoute, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D8283: tests: simplify test-fix-topology.t slightly by using a `(case !)`

2020-03-13 Thread martinvonz (Martin von Zweigbergk)
martinvonz updated this revision to Diff 20770.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D8283?vs=20769&id=20770

BRANCH
  default

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8283/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8283

AFFECTED FILES
  tests/test-fix-topology.t

CHANGE DETAILS

diff --git a/tests/test-fix-topology.t b/tests/test-fix-topology.t
--- a/tests/test-fix-topology.t
+++ b/tests/test-fix-topology.t
@@ -128,12 +128,8 @@
 
 Fix all but the root revision and its four children.
 
-#if obsstore-on
   $ hg fix -r '2|4|7|8|9' --working-dir
-#else
-  $ hg fix -r '2|4|7|8|9' --working-dir
-  saved backup bundle to * (glob)
-#endif
+  saved backup bundle to * (glob) (obsstore-off !)
 
 The five revisions remain, but the other revisions were fixed and replaced. All
 parent pointers have been accurately set to reproduce the previous topology



To: martinvonz, #hg-reviewers, Alphare
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D8232: phabricator: add a helper function to convert DREVSPECs to a DREV dict list

2020-03-13 Thread mharbison72 (Matt Harbison)
mharbison72 added a comment.


  In D8232#123673 , @Alphare wrote:
  
  > This seems like something that can easily have a few simple unit tests
  
  The next patch attempts to provide coverage.  I'm not sure how else to test 
this, because it wants to communicate with the server to resolve these values, 
so then it needs to be run as a command to hook up with the VCR infrastructure.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8232/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8232

To: mharbison72, #hg-reviewers
Cc: Alphare, Kwan, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D8284: fix: disallow `hg fix --all --working-dir`

2020-03-13 Thread martinvonz (Martin von Zweigbergk)
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  `--all` implies `--working-dir`, so it's probably a mistake if the
  user uses both.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D8284

AFFECTED FILES
  hgext/fix.py
  tests/test-fix-topology.t

CHANGE DETAILS

diff --git a/tests/test-fix-topology.t b/tests/test-fix-topology.t
--- a/tests/test-fix-topology.t
+++ b/tests/test-fix-topology.t
@@ -271,6 +271,9 @@
 
   $ hg init fixall
   $ cd fixall
+  $ hg fix --all --working-dir
+  abort: cannot specify both --working-dir and --all
+  [255]
 
 #if obsstore-on
   $ printf "one\n" > foo.whole
diff --git a/hgext/fix.py b/hgext/fix.py
--- a/hgext/fix.py
+++ b/hgext/fix.py
@@ -250,6 +250,7 @@
 """
 opts = pycompat.byteskwargs(opts)
 cmdutil.check_at_most_one_arg(opts, b'all', b'rev')
+cmdutil.check_incompatible_arguments(opts, b'working_dir', [b'all'])
 if opts[b'all']:
 opts[b'rev'] = [b'not public() and not obsolete()']
 opts[b'working_dir'] = True



To: martinvonz, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D8285: fix: refactor getrevstofix() to define revisions first, then validate them

2020-03-13 Thread martinvonz (Martin von Zweigbergk)
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  This refactoring makes it easier to add a new way of specifying
  revisions (I'm about to add a `--source`, which adds the specified
  revisions and their descendants).

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D8285

AFFECTED FILES
  hgext/fix.py

CHANGE DETAILS

diff --git a/hgext/fix.py b/hgext/fix.py
--- a/hgext/fix.py
+++ b/hgext/fix.py
@@ -400,15 +400,16 @@
 def getrevstofix(ui, repo, opts):
 """Returns the set of revision numbers that should be fixed"""
 revs = set(scmutil.revrange(repo, opts[b'rev']))
+if opts.get(b'working_dir'):
+revs.add(wdirrev)
 for rev in revs:
 checkfixablectx(ui, repo, repo[rev])
-if revs:
+# Allow fixing only wdir() even if there's an unfinished operation
+if not (len(revs) == 1 and wdirrev in revs):
 cmdutil.checkunfinished(repo)
 rewriteutil.precheck(repo, revs, b'fix')
-if opts.get(b'working_dir'):
-revs.add(wdirrev)
-if list(merge.mergestate.read(repo).unresolved()):
-raise error.Abort(b'unresolved conflicts', hint=b"use 'hg 
resolve'")
+if wdirrev in revs and list(merge.mergestate.read(repo).unresolved()):
+raise error.Abort(b'unresolved conflicts', hint=b"use 'hg resolve'")
 if not revs:
 raise error.Abort(
 b'no changesets specified', hint=b'use --rev or --working-dir'



To: martinvonz, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D8286: fix: move handling of --all into getrevstofix() for consistency

2020-03-13 Thread martinvonz (Martin von Zweigbergk)
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D8286

AFFECTED FILES
  hgext/fix.py

CHANGE DETAILS

diff --git a/hgext/fix.py b/hgext/fix.py
--- a/hgext/fix.py
+++ b/hgext/fix.py
@@ -251,9 +251,7 @@
 opts = pycompat.byteskwargs(opts)
 cmdutil.check_at_most_one_arg(opts, b'all', b'rev')
 cmdutil.check_incompatible_arguments(opts, b'working_dir', [b'all'])
-if opts[b'all']:
-opts[b'rev'] = [b'not public() and not obsolete()']
-opts[b'working_dir'] = True
+
 with repo.wlock(), repo.lock(), repo.transaction(b'fix'):
 revstofix = getrevstofix(ui, repo, opts)
 basectxs = getbasectxs(repo, opts, revstofix)
@@ -399,9 +397,12 @@
 
 def getrevstofix(ui, repo, opts):
 """Returns the set of revision numbers that should be fixed"""
-revs = set(scmutil.revrange(repo, opts[b'rev']))
-if opts.get(b'working_dir'):
-revs.add(wdirrev)
+if opts[b'all']:
+revs = repo.revs(b'(not public() and not obsolete()) or wdir()')
+else:
+revs = set(scmutil.revrange(repo, opts[b'rev']))
+if opts.get(b'working_dir'):
+revs.add(wdirrev)
 for rev in revs:
 checkfixablectx(ui, repo, repo[rev])
 # Allow fixing only wdir() even if there's an unfinished operation



To: martinvonz, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D8288: fix: mark -r as advanced

2020-03-13 Thread martinvonz (Martin von Zweigbergk)
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  See the previous patch for reasoning. I planned to even mark it
  deprecated, but someone (timeless?) on the #mercurial IRC channel said
  they sometimes wanted to use `-r` with its existing semantics.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D8288

AFFECTED FILES
  hgext/fix.py
  tests/test-fix.t

CHANGE DETAILS

diff --git a/tests/test-fix.t b/tests/test-fix.t
--- a/tests/test-fix.t
+++ b/tests/test-fix.t
@@ -107,7 +107,6 @@
   --allfix all non-public non-obsolete revisions
   --base REV [+]   revisions to diff against (overrides automatic 
selection,
and applies to every revision being fixed)
-   -r --rev REV [+]revisions to fix
-s --source REV [+] fix descendants of these revisions
-w --working-dirfix the working directory
   --whole  always fix every line of a file
diff --git a/hgext/fix.py b/hgext/fix.py
--- a/hgext/fix.py
+++ b/hgext/fix.py
@@ -213,7 +213,7 @@
 ),
 _(b'REV'),
 )
-revopt = (b'r', b'rev', [], _(b'revisions to fix'), _(b'REV'))
+revopt = (b'r', b'rev', [], _(b'revisions to fix (ADVANCED)'), _(b'REV'))
 sourceopt = (
 b's',
 b'source',



To: martinvonz, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D8287: fix: add a -s option to format a revision and its descendants

2020-03-13 Thread martinvonz (Martin von Zweigbergk)
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  `hg fix -r abc123` will format that commit but not its
  descendants. That seems expected given the option name (`-r`), but
  it's very rarely what the user wants to do. The problem is that any
  descendants of that commit will not be formatted, leaving them as
  orphans that are hard to evolve. They are hard to evolve because the
  new parent will have formatting changes that the orphan doesn't have.
  
  I talked to Danny Hooper (who wrote most of the fix extension) about
  the problem and we agreed that deprecating `-r` in favor of a new `-s`
  argument (mimicing rebase's `-s`) would be a good way of reducing the
  risk that users end up with these hard-to-evolve orphans. So that's
  what this patch implements.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D8287

AFFECTED FILES
  hgext/fix.py
  tests/test-fix-topology.t
  tests/test-fix.t

CHANGE DETAILS

diff --git a/tests/test-fix.t b/tests/test-fix.t
--- a/tests/test-fix.t
+++ b/tests/test-fix.t
@@ -104,12 +104,13 @@
   
   options ([+] can be repeated):
   
-  --all  fix all non-public non-obsolete revisions
-  --base REV [+] revisions to diff against (overrides automatic selection,
- and applies to every revision being fixed)
-   -r --rev REV [+]  revisions to fix
-   -w --working-dir  fix the working directory
-  --wholealways fix every line of a file
+  --allfix all non-public non-obsolete revisions
+  --base REV [+]   revisions to diff against (overrides automatic 
selection,
+   and applies to every revision being fixed)
+   -r --rev REV [+]revisions to fix
+   -s --source REV [+] fix descendants of these revisions
+   -w --working-dirfix the working directory
+  --whole  always fix every line of a file
   
   (some details hidden, use --verbose to show complete help)
 
diff --git a/tests/test-fix-topology.t b/tests/test-fix-topology.t
--- a/tests/test-fix-topology.t
+++ b/tests/test-fix-topology.t
@@ -21,6 +21,7 @@
   $ cat >> $HGRCPATH < [extensions]
   > fix =
+  > strip =
   > [fix]
   > uppercase-whole-file:command="$PYTHON" $UPPERCASEPY
   > uppercase-whole-file:pattern=set:**
@@ -262,6 +263,111 @@
 
   $ cd ..
 
+
+Test the --source option. We only do this with obsstore on to avoid duplicating
+test code. We rely on the other tests to prove that obsolescence is not an
+important factor here.
+
+#if obsstore-on
+  $ hg init source-arg
+  $ cd source-arg
+  $ printf "\n" > a
+  $ hg commit -Am "change A"
+  adding a
+  $ printf "\n" > b
+  $ hg commit -Am "change B"
+  adding b
+  $ printf "\n" > c
+  $ hg commit -Am "change C"
+  adding c
+  $ hg checkout 0
+  0 files updated, 0 files merged, 2 files removed, 0 files unresolved
+  $ printf "\n" > d
+  $ hg commit -Am "change D"
+  adding d
+  created new head
+  $ hg log --graph --template '{rev} {desc}\n'
+  @  3 change D
+  |
+  | o  2 change C
+  | |
+  | o  1 change B
+  |/
+  o  0 change A
+  
+
+Test passing 'wdir()' to --source
+  $ printf "\n" > x
+  $ hg add x
+  $ hg fix -s 'wdir()'
+  $ cat *
+  
+  
+  
+
+Test passing '.' to --source
+  $ printf "\n" > x
+  $ hg fix -s .
+  $ hg log --graph --template '{rev} {desc}\n'
+  @  4 change D
+  |
+  | o  2 change C
+  | |
+  | o  1 change B
+  |/
+  o  0 change A
+  
+  $ cat *
+  
+  
+  
+  $ hg strip -qf 4
+  $ hg co -q 3
+
+Test passing other branch to --source
+  $ printf "\n" > x
+  $ hg add x
+  $ hg fix -s 2
+  $ hg log --graph --template '{rev} {desc}\n'
+  o  4 change C
+  |
+  | @  3 change D
+  | |
+  o |  1 change B
+  |/
+  o  0 change A
+  
+  $ hg cat -r 4 b c
+  
+  
+  $ cat *
+  
+  
+  
+  $ hg strip -qf 4
+
+Test passing multiple revisions to --source
+  $ hg fix -s '2 + .'
+  $ hg log --graph --template '{rev} {desc}\n'
+  @  5 change D
+  |
+  | o  4 change C
+  | |
+  | o  1 change B
+  |/
+  o  0 change A
+  
+  $ hg cat -r 4 b c
+  
+  
+  $ cat *
+  
+  
+  
+
+  $ cd ..
+#endif
+
 The --all flag should fix anything that wouldn't cause a problem if you fixed
 it, including the working copy. Obsolete revisions are not fixed because that
 could cause divergence. Public revisions would cause an abort because they are
diff --git a/hgext/fix.py b/hgext/fix.py
--- a/hgext/fix.py
+++ b/hgext/fix.py
@@ -214,6 +214,13 @@
 _(b'REV'),
 )
 revopt = (b'r', b'rev', [], _(b'revisions to fix'), _(b'REV'))
+sourceopt = (
+b's',
+b'source',
+[],
+_(b'fix descendants of these revisions'),
+_(b'REV'),
+)
 wdiropt = (b'w', b'working-dir', False, _(b'fix the working directory'))
 wholeopt = (b'', b'whole', False, _(b'always fix every line of a file'))
 usage = _(b'[OPTION]... [FILE]...')
@@ -221,7 +228,7 @@
 
 @command(

D8288: fix: mark -r as advanced

2020-03-13 Thread martinvonz (Martin von Zweigbergk)
martinvonz updated this revision to Diff 20777.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D8288?vs=20775&id=20777

BRANCH
  default

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8288/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8288

AFFECTED FILES
  hgext/fix.py
  tests/test-fix.t

CHANGE DETAILS

diff --git a/tests/test-fix.t b/tests/test-fix.t
--- a/tests/test-fix.t
+++ b/tests/test-fix.t
@@ -107,7 +107,6 @@
   --allfix all non-public non-obsolete revisions
   --base REV [+]   revisions to diff against (overrides automatic 
selection,
and applies to every revision being fixed)
-   -r --rev REV [+]revisions to fix
-s --source REV [+] fix descendants of these revisions
-w --working-dirfix the working directory
   --whole  always fix every line of a file
diff --git a/hgext/fix.py b/hgext/fix.py
--- a/hgext/fix.py
+++ b/hgext/fix.py
@@ -213,7 +213,7 @@
 ),
 _(b'REV'),
 )
-revopt = (b'r', b'rev', [], _(b'revisions to fix'), _(b'REV'))
+revopt = (b'r', b'rev', [], _(b'revisions to fix (ADVANCED)'), _(b'REV'))
 sourceopt = (
 b's',
 b'source',



To: martinvonz, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D8287: fix: add a -s option to format a revision and its descendants

2020-03-13 Thread martinvonz (Martin von Zweigbergk)
martinvonz updated this revision to Diff 20776.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D8287?vs=20774&id=20776

BRANCH
  default

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8287/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8287

AFFECTED FILES
  hgext/fix.py
  tests/test-fix-topology.t
  tests/test-fix.t

CHANGE DETAILS

diff --git a/tests/test-fix.t b/tests/test-fix.t
--- a/tests/test-fix.t
+++ b/tests/test-fix.t
@@ -104,12 +104,13 @@
   
   options ([+] can be repeated):
   
-  --all  fix all non-public non-obsolete revisions
-  --base REV [+] revisions to diff against (overrides automatic selection,
- and applies to every revision being fixed)
-   -r --rev REV [+]  revisions to fix
-   -w --working-dir  fix the working directory
-  --wholealways fix every line of a file
+  --allfix all non-public non-obsolete revisions
+  --base REV [+]   revisions to diff against (overrides automatic 
selection,
+   and applies to every revision being fixed)
+   -r --rev REV [+]revisions to fix
+   -s --source REV [+] fix descendants of these revisions
+   -w --working-dirfix the working directory
+  --whole  always fix every line of a file
   
   (some details hidden, use --verbose to show complete help)
 
diff --git a/tests/test-fix-topology.t b/tests/test-fix-topology.t
--- a/tests/test-fix-topology.t
+++ b/tests/test-fix-topology.t
@@ -21,6 +21,7 @@
   $ cat >> $HGRCPATH < [extensions]
   > fix =
+  > strip =
   > [fix]
   > uppercase-whole-file:command="$PYTHON" $UPPERCASEPY
   > uppercase-whole-file:pattern=set:**
@@ -262,6 +263,111 @@
 
   $ cd ..
 
+
+Test the --source option. We only do this with obsstore on to avoid duplicating
+test code. We rely on the other tests to prove that obsolescence is not an
+important factor here.
+
+#if obsstore-on
+  $ hg init source-arg
+  $ cd source-arg
+  $ printf "\n" > a
+  $ hg commit -Am "change A"
+  adding a
+  $ printf "\n" > b
+  $ hg commit -Am "change B"
+  adding b
+  $ printf "\n" > c
+  $ hg commit -Am "change C"
+  adding c
+  $ hg checkout 0
+  0 files updated, 0 files merged, 2 files removed, 0 files unresolved
+  $ printf "\n" > d
+  $ hg commit -Am "change D"
+  adding d
+  created new head
+  $ hg log --graph --template '{rev} {desc}\n'
+  @  3 change D
+  |
+  | o  2 change C
+  | |
+  | o  1 change B
+  |/
+  o  0 change A
+  
+
+Test passing 'wdir()' to --source
+  $ printf "\n" > x
+  $ hg add x
+  $ hg fix -s 'wdir()'
+  $ cat *
+  
+  
+  
+
+Test passing '.' to --source
+  $ printf "\n" > x
+  $ hg fix -s .
+  $ hg log --graph --template '{rev} {desc}\n'
+  @  4 change D
+  |
+  | o  2 change C
+  | |
+  | o  1 change B
+  |/
+  o  0 change A
+  
+  $ cat *
+  
+  
+  
+  $ hg strip -qf 4
+  $ hg co -q 3
+
+Test passing other branch to --source
+  $ printf "\n" > x
+  $ hg add x
+  $ hg fix -s 2
+  $ hg log --graph --template '{rev} {desc}\n'
+  o  4 change C
+  |
+  | @  3 change D
+  | |
+  o |  1 change B
+  |/
+  o  0 change A
+  
+  $ hg cat -r 4 b c
+  
+  
+  $ cat *
+  
+  
+  
+  $ hg strip -qf 4
+
+Test passing multiple revisions to --source
+  $ hg fix -s '2 + .'
+  $ hg log --graph --template '{rev} {desc}\n'
+  @  5 change D
+  |
+  | o  4 change C
+  | |
+  | o  1 change B
+  |/
+  o  0 change A
+  
+  $ hg cat -r 4 b c
+  
+  
+  $ cat *
+  
+  
+  
+
+  $ cd ..
+#endif
+
 The --all flag should fix anything that wouldn't cause a problem if you fixed
 it, including the working copy. Obsolete revisions are not fixed because that
 could cause divergence. Public revisions would cause an abort because they are
diff --git a/hgext/fix.py b/hgext/fix.py
--- a/hgext/fix.py
+++ b/hgext/fix.py
@@ -214,6 +214,13 @@
 _(b'REV'),
 )
 revopt = (b'r', b'rev', [], _(b'revisions to fix'), _(b'REV'))
+sourceopt = (
+b's',
+b'source',
+[],
+_(b'fix descendants of these revisions'),
+_(b'REV'),
+)
 wdiropt = (b'w', b'working-dir', False, _(b'fix the working directory'))
 wholeopt = (b'', b'whole', False, _(b'always fix every line of a file'))
 usage = _(b'[OPTION]... [FILE]...')
@@ -221,7 +228,7 @@
 
 @command(
 b'fix',
-[allopt, baseopt, revopt, wdiropt, wholeopt],
+[allopt, baseopt, revopt, sourceopt, wdiropt, wholeopt],
 usage,
 helpcategory=command.CATEGORY_FILE_CONTENTS,
 )
@@ -250,7 +257,9 @@
 """
 opts = pycompat.byteskwargs(opts)
 cmdutil.check_at_most_one_arg(opts, b'all', b'rev')
-cmdutil.check_incompatible_arguments(opts, b'working_dir', [b'all'])
+cmdutil.check_incompatible_arguments(
+opts, b'working_dir', [b'all', b'source']
+)
 
 with repo.wlock(), repo.lock(), repo.transaction(b'fix'):
 revstofix = getrevstofix(ui, repo, opts)
@@ -399,6 +408,14 @@
 """Returns the set of revision

D8287: fix: add a -s option to format a revision and its descendants

2020-03-13 Thread hooper (Danny Hooper)
hooper added a comment.


  D8283 :D8288 
 all looks good to me.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8287/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8287

To: martinvonz, #hg-reviewers
Cc: hooper, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D8290: morestatus: recommend `hg resolve --clear` when appropriate

2020-03-13 Thread martinvonz (Martin von Zweigbergk)
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D8290

AFFECTED FILES
  mercurial/cmdutil.py
  tests/test-update-branches.t

CHANGE DETAILS

diff --git a/tests/test-update-branches.t b/tests/test-update-branches.t
--- a/tests/test-update-branches.t
+++ b/tests/test-update-branches.t
@@ -635,6 +635,7 @@
   $ hg status
   M foo
   # No unresolved merge conflicts.
+  # Use 'hg resolve --clear' to clear the merge state.
   
   $ hg status -Tjson
   [
diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -883,6 +883,10 @@
 
 else:
 msg = _(b'No unresolved merge conflicts.')
+if not self.unfinishedop:
+msg += _(
+b"\nUse 'hg resolve --clear' to clear the merge state."
+)
 
 fm.plain(b'%s\n' % _commentlines(msg), label=self._label)
 



To: martinvonz, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D8289: resolve: add a --clear option for clearing the merge state

2020-03-13 Thread martinvonz (Martin von Zweigbergk)
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D8289

AFFECTED FILES
  mercurial/commands.py
  relnotes/next
  tests/test-completion.t
  tests/test-resolve.t

CHANGE DETAILS

diff --git a/tests/test-resolve.t b/tests/test-resolve.t
--- a/tests/test-resolve.t
+++ b/tests/test-resolve.t
@@ -221,6 +221,31 @@
   (use 'hg resolve' to resolve)
   [255]
 
+test `hg resolve --clear`
+  $ hg up -qC 0
+  $ echo quux >> file1
+  $ hg up 1
+  merging file1
+  warning: conflicts while merging file1! (edit, then use 'hg resolve --mark')
+  1 files updated, 0 files merged, 0 files removed, 1 files unresolved
+  use 'hg resolve' to retry unresolved file merges
+  [1]
+aborts if there are unresolved files
+  $ hg resolve --clear
+  abort: unresolved merge conflicts
+  [255]
+clears resolved conflicts
+  $ echo resolved > file1
+  $ hg resolve -m file1
+  (no more unresolved files)
+  $ hg resolve -l
+  R file1
+  $ hg resolve --clear
+  $ hg resolve -l
+no effect if there
+  $ hg resolve --clear
+  $ hg resolve -l
+
 set up conflict-free merge
 
   $ hg up -qC 3
diff --git a/tests/test-completion.t b/tests/test-completion.t
--- a/tests/test-completion.t
+++ b/tests/test-completion.t
@@ -350,7 +350,7 @@
   recover: verify
   remove: after, force, subrepos, include, exclude, dry-run
   rename: after, force, include, exclude, dry-run
-  resolve: all, list, mark, unmark, no-status, re-merge, tool, include, 
exclude, template
+  resolve: all, clear, list, mark, unmark, no-status, re-merge, tool, include, 
exclude, template
   revert: all, date, rev, no-backup, interactive, include, exclude, dry-run
   rollback: dry-run, force
   root: template
diff --git a/relnotes/next b/relnotes/next
--- a/relnotes/next
+++ b/relnotes/next
@@ -29,6 +29,10 @@
  * `hg debugmergestate` output is now templated, which may be useful
e.g. for IDEs that want to help the user resolve merge conflicts.
 
+ * New `hg resolve --clear` for clearing the merge state. The merge
+   state is normally cleared on commit. The new option can be useful
+   when you can't commit because the working copy is clean.
+
 
 == New Experimental Features ==
 
diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -5816,6 +5816,7 @@
 b'resolve',
 [
 (b'a', b'all', None, _(b'select all unresolved files')),
+(b'', b'clear', None, _(b'clear resolved merge state')),
 (b'l', b'list', None, _(b'list state of files needing merge')),
 (b'm', b'mark', None, _(b'mark files as resolved')),
 (b'u', b'unmark', None, _(b'mark files as unresolved')),
@@ -5862,6 +5863,11 @@
   You can use ``set:unresolved()`` or ``set:resolved()`` to filter
   the list. See :hg:`help filesets` for details.
 
+- :hg:`resolve --clear`: clear the merge state.
+  This is not allowed when there are unresolved files. Note that
+  :hg:`commit` will also clear the conflicts, so this option is primarily
+  useful when you cannot commit because the working copy is clean.
+
 .. note::
 
Mercurial will not let you commit files with unresolved merge
@@ -5883,10 +5889,12 @@
 
 opts = pycompat.byteskwargs(opts)
 confirm = ui.configbool(b'commands', b'resolve.confirm')
-flaglist = b'all mark unmark list no_status re_merge'.split()
-all, mark, unmark, show, nostatus, remerge = [opts.get(o) for o in 
flaglist]
-
-actioncount = len(list(filter(None, [show, mark, unmark, remerge])))
+flaglist = b'all clear mark unmark list no_status re_merge'.split()
+all, clear, mark, unmark, show, nostatus, remerge = [
+opts.get(o) for o in flaglist
+]
+
+actioncount = len(list(filter(None, [clear, show, mark, unmark, remerge])))
 if actioncount > 1:
 raise error.Abort(_(b"too many actions specified"))
 elif actioncount == 0 and ui.configbool(
@@ -5896,7 +5904,7 @@
 raise error.Abort(_(b'no action specified'), hint=hint)
 if pats and all:
 raise error.Abort(_(b"can't specify --all and patterns"))
-if not (all or pats or show or mark or unmark):
+if not (all or pats or clear or show or mark or unmark):
 raise error.Abort(
 _(b'no files or directories specified'),
 hint=b'use --all to re-merge all unresolved files',
@@ -5927,6 +5935,14 @@
 
 uipathfn = scmutil.getuipathfn(repo)
 
+if clear:
+ms = mergemod.mergestate.read(repo)
+if ms.unresolvedcount():
+raise error.Abort(_(b'unresolved merge conflicts'))
+
+ms.reset()
+return 0
+
 if show:
 ui.pager(b'resolve')
 fm = ui.formatter(b'resolve', opts)



To: martinvonz, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mer

D8287: fix: add a -s option to format a revision and its descendants

2020-03-13 Thread mharbison72 (Matt Harbison)
mharbison72 added a comment.


  Thanks for this!

INLINE COMMENTS

> fix.py:221
> +[],
> +_(b'fix descendants of these revisions'),
> +_(b'REV'),

nit: is `descendants` usually self referential?  (The revset is, but IDK if 
that's what a casual reader would expect here.)  The same option for rebase 
says:

  rebase the specified changeset and descendants

> fix.py:412-413
> +elif opts[b'source']:
> +source_revs = scmutil.revrange(repo, opts[b'source'])
> +revs = set(repo.revs(b'%ld::', source_revs))
> +if wdirrev in source_revs:

Any idea why rebase seems to convert the `source` arg to a list before passing 
to `revrange()`, and also does `repo.revs(b'(%ld)::', src) or src`?  IDK if 
it's trying to handle something that should be handled here for consistent 
behavior.

https://www.mercurial-scm.org/repo/hg/file/tip/hgext/rebase.py#l1264

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8287/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8287

To: martinvonz, #hg-reviewers
Cc: mharbison72, hooper, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D8287: fix: add a -s option to format a revision and its descendants

2020-03-13 Thread martinvonz (Martin von Zweigbergk)
martinvonz added inline comments.

INLINE COMMENTS

> mharbison72 wrote in fix.py:221
> nit: is `descendants` usually self referential?  (The revset is, but IDK if 
> that's what a casual reader would expect here.)  The same option for rebase 
> says:
> 
>   rebase the specified changeset and descendants

Ah, good point. I'll copy the text from rebase. Thanks!

> mharbison72 wrote in fix.py:412-413
> Any idea why rebase seems to convert the `source` arg to a list before 
> passing to `revrange()`, and also does `repo.revs(b'(%ld)::', src) or src`?  
> IDK if it's trying to handle something that should be handled here for 
> consistent behavior.
> 
> https://www.mercurial-scm.org/repo/hg/file/tip/hgext/rebase.py#l1264

> Any idea why rebase seems to convert the source arg to a list before passing 
> to revrange(),

I'm pretty sure that's because rebase's `--source` argument is not list-valued, 
i.e. `hg rebase --source foo --source bar ...` will rebase only `bar::` (I 
didn't test that, though). We should probably change that, even though it would 
be a small BC (same thing with `--base`).

> and also does repo.revs(b'(%ld)::', src) or src?

Oh, maybe that `or src` is to handle the `wdir` case I mention two lines down 
here? Let me check... Yep, that's it: D8057 
 (written by me just ~6 weeks ago and I 
had already forgotten :P). We can't replicate that trick here because we 
support multiple source revisions. We should instead remember to handle that 
correctly if we teach rebase to support multiple source revisions.

> IDK if it's trying to handle something that should be handled here for 
> consistent behavior.

Good point and thanks for checking!

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8287/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8287

To: martinvonz, #hg-reviewers
Cc: mharbison72, hooper, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D8288: fix: mark -r as advanced

2020-03-13 Thread martinvonz (Martin von Zweigbergk)
martinvonz updated this revision to Diff 20781.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D8288?vs=20777&id=20781

BRANCH
  default

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8288/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8288

AFFECTED FILES
  hgext/fix.py
  tests/test-fix.t

CHANGE DETAILS

diff --git a/tests/test-fix.t b/tests/test-fix.t
--- a/tests/test-fix.t
+++ b/tests/test-fix.t
@@ -107,7 +107,6 @@
   --allfix all non-public non-obsolete revisions
   --base REV [+]   revisions to diff against (overrides automatic 
selection,
and applies to every revision being fixed)
-   -r --rev REV [+]revisions to fix
-s --source REV [+] fix the specified revisions and their descendants
-w --working-dirfix the working directory
   --whole  always fix every line of a file
diff --git a/hgext/fix.py b/hgext/fix.py
--- a/hgext/fix.py
+++ b/hgext/fix.py
@@ -213,7 +213,7 @@
 ),
 _(b'REV'),
 )
-revopt = (b'r', b'rev', [], _(b'revisions to fix'), _(b'REV'))
+revopt = (b'r', b'rev', [], _(b'revisions to fix (ADVANCED)'), _(b'REV'))
 sourceopt = (
 b's',
 b'source',



To: martinvonz, #hg-reviewers, mharbison72
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D8287: fix: add a -s option to format a revision and its descendants

2020-03-13 Thread martinvonz (Martin von Zweigbergk)
martinvonz updated this revision to Diff 20780.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D8287?vs=20776&id=20780

BRANCH
  default

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8287/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8287

AFFECTED FILES
  hgext/fix.py
  tests/test-fix-topology.t
  tests/test-fix.t

CHANGE DETAILS

diff --git a/tests/test-fix.t b/tests/test-fix.t
--- a/tests/test-fix.t
+++ b/tests/test-fix.t
@@ -104,12 +104,13 @@
   
   options ([+] can be repeated):
   
-  --all  fix all non-public non-obsolete revisions
-  --base REV [+] revisions to diff against (overrides automatic selection,
- and applies to every revision being fixed)
-   -r --rev REV [+]  revisions to fix
-   -w --working-dir  fix the working directory
-  --wholealways fix every line of a file
+  --allfix all non-public non-obsolete revisions
+  --base REV [+]   revisions to diff against (overrides automatic 
selection,
+   and applies to every revision being fixed)
+   -r --rev REV [+]revisions to fix
+   -s --source REV [+] fix the specified revisions and their descendants
+   -w --working-dirfix the working directory
+  --whole  always fix every line of a file
   
   (some details hidden, use --verbose to show complete help)
 
diff --git a/tests/test-fix-topology.t b/tests/test-fix-topology.t
--- a/tests/test-fix-topology.t
+++ b/tests/test-fix-topology.t
@@ -21,6 +21,7 @@
   $ cat >> $HGRCPATH < [extensions]
   > fix =
+  > strip =
   > [fix]
   > uppercase-whole-file:command="$PYTHON" $UPPERCASEPY
   > uppercase-whole-file:pattern=set:**
@@ -262,6 +263,111 @@
 
   $ cd ..
 
+
+Test the --source option. We only do this with obsstore on to avoid duplicating
+test code. We rely on the other tests to prove that obsolescence is not an
+important factor here.
+
+#if obsstore-on
+  $ hg init source-arg
+  $ cd source-arg
+  $ printf "\n" > a
+  $ hg commit -Am "change A"
+  adding a
+  $ printf "\n" > b
+  $ hg commit -Am "change B"
+  adding b
+  $ printf "\n" > c
+  $ hg commit -Am "change C"
+  adding c
+  $ hg checkout 0
+  0 files updated, 0 files merged, 2 files removed, 0 files unresolved
+  $ printf "\n" > d
+  $ hg commit -Am "change D"
+  adding d
+  created new head
+  $ hg log --graph --template '{rev} {desc}\n'
+  @  3 change D
+  |
+  | o  2 change C
+  | |
+  | o  1 change B
+  |/
+  o  0 change A
+  
+
+Test passing 'wdir()' to --source
+  $ printf "\n" > x
+  $ hg add x
+  $ hg fix -s 'wdir()'
+  $ cat *
+  
+  
+  
+
+Test passing '.' to --source
+  $ printf "\n" > x
+  $ hg fix -s .
+  $ hg log --graph --template '{rev} {desc}\n'
+  @  4 change D
+  |
+  | o  2 change C
+  | |
+  | o  1 change B
+  |/
+  o  0 change A
+  
+  $ cat *
+  
+  
+  
+  $ hg strip -qf 4
+  $ hg co -q 3
+
+Test passing other branch to --source
+  $ printf "\n" > x
+  $ hg add x
+  $ hg fix -s 2
+  $ hg log --graph --template '{rev} {desc}\n'
+  o  4 change C
+  |
+  | @  3 change D
+  | |
+  o |  1 change B
+  |/
+  o  0 change A
+  
+  $ hg cat -r 4 b c
+  
+  
+  $ cat *
+  
+  
+  
+  $ hg strip -qf 4
+
+Test passing multiple revisions to --source
+  $ hg fix -s '2 + .'
+  $ hg log --graph --template '{rev} {desc}\n'
+  @  5 change D
+  |
+  | o  4 change C
+  | |
+  | o  1 change B
+  |/
+  o  0 change A
+  
+  $ hg cat -r 4 b c
+  
+  
+  $ cat *
+  
+  
+  
+
+  $ cd ..
+#endif
+
 The --all flag should fix anything that wouldn't cause a problem if you fixed
 it, including the working copy. Obsolete revisions are not fixed because that
 could cause divergence. Public revisions would cause an abort because they are
diff --git a/hgext/fix.py b/hgext/fix.py
--- a/hgext/fix.py
+++ b/hgext/fix.py
@@ -214,6 +214,13 @@
 _(b'REV'),
 )
 revopt = (b'r', b'rev', [], _(b'revisions to fix'), _(b'REV'))
+sourceopt = (
+b's',
+b'source',
+[],
+_(b'fix the specified revisions and their descendants'),
+_(b'REV'),
+)
 wdiropt = (b'w', b'working-dir', False, _(b'fix the working directory'))
 wholeopt = (b'', b'whole', False, _(b'always fix every line of a file'))
 usage = _(b'[OPTION]... [FILE]...')
@@ -221,7 +228,7 @@
 
 @command(
 b'fix',
-[allopt, baseopt, revopt, wdiropt, wholeopt],
+[allopt, baseopt, revopt, sourceopt, wdiropt, wholeopt],
 usage,
 helpcategory=command.CATEGORY_FILE_CONTENTS,
 )
@@ -250,7 +257,9 @@
 """
 opts = pycompat.byteskwargs(opts)
 cmdutil.check_at_most_one_arg(opts, b'all', b'rev')
-cmdutil.check_incompatible_arguments(opts, b'working_dir', [b'all'])
+cmdutil.check_incompatible_arguments(
+opts, b'working_dir', [b'all', b'source']
+)
 
 with repo.wlock(), repo.lock(), repo.transaction(b'fix'):
 revstofix = getrevstofix(ui, repo, opts)
@@ -399,6 +408,14 @@
 

D8291: rebase: remove unused defaults argument values from _definedestmap()

2020-03-13 Thread martinvonz (Martin von Zweigbergk)
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  The caller always provides values for these arguments.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D8291

AFFECTED FILES
  hgext/rebase.py

CHANGE DETAILS

diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -1217,16 +1217,7 @@
 rbsrt._finishrebase()
 
 
-def _definedestmap(
-ui,
-repo,
-inmemory,
-destf=None,
-srcf=None,
-basef=None,
-revf=None,
-destspace=None,
-):
+def _definedestmap(ui, repo, inmemory, destf, srcf, basef, revf, destspace):
 """use revisions argument to define destmap {srcrev: destrev}"""
 if revf is None:
 revf = []



To: martinvonz, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D8292: rebase: accept multiple --source arguments (BC)

2020-03-13 Thread martinvonz (Martin von Zweigbergk)
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  I think it's a little surprising that `hg rebase -s A -s B` rebases
  only `B::` and ignores `A`. That's because the `-s` flag is not a
  repeated flag. This patch makes it a repeated flag.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D8292

AFFECTED FILES
  hgext/rebase.py
  relnotes/next
  tests/test-rebase-dest.t
  tests/test-rebase-parameters.t

CHANGE DETAILS

diff --git a/tests/test-rebase-parameters.t b/tests/test-rebase-parameters.t
--- a/tests/test-rebase-parameters.t
+++ b/tests/test-rebase-parameters.t
@@ -100,6 +100,10 @@
   abort: cannot rebase the working copy
   [255]
 
+  $ hg rebase --source 1 --source 'wdir()' --dest 6
+  abort: cannot rebase the working copy
+  [255]
+
   $ hg rebase --source '1 & !1' --dest 8
   empty "source" revision set - nothing to rebase
   [1]
diff --git a/tests/test-rebase-dest.t b/tests/test-rebase-dest.t
--- a/tests/test-rebase-dest.t
+++ b/tests/test-rebase-dest.t
@@ -272,7 +272,7 @@
   
 Move to a previous parent:
 
-  $ rebasewithdag -s E+F+G -d 'SRC^^' <<'EOS'
+  $ rebasewithdag -s E -s F -s G -d 'SRC^^' <<'EOS'
   > H
   > |
   >   D G
diff --git a/relnotes/next b/relnotes/next
--- a/relnotes/next
+++ b/relnotes/next
@@ -58,6 +58,13 @@
can use the new `conflictparents()` revset for finding the other
parent during a conflict.
 
+ * `hg rebase` now accepts repeated `--source` arguments. For example,
+   `hg rebase --source 'A + B'` is equivalent to `hg rebase --source A
+   --source B`. This is a backwards-incompatible change because it
+   will break overriding an alias `myrebase = rebase --source A` by
+   `hg myrebase --source B` (it will now rebase `(A + B)::` instead of
+   `B::`).
+
  * `hg recover` does not verify the validity of the whole repository
anymore. You can pass `--verify` or call `hg verify` if necessary.
 
diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -815,8 +815,8 @@
 (
 b's',
 b'source',
-b'',
-_(b'rebase the specified changeset and descendants'),
+[],
+_(b'rebase the specified changesets and their descendants'),
 _(b'REV'),
 ),
 (
@@ -1186,7 +1186,7 @@
 repo,
 inmemory,
 opts.get(b'dest', None),
-opts.get(b'source', None),
+opts.get(b'source', []),
 opts.get(b'base', None),
 opts.get(b'rev', []),
 destspace=destspace,
@@ -1243,11 +1243,12 @@
 ui.status(_(b'empty "rev" revision set - nothing to rebase\n'))
 return None
 elif srcf:
-src = scmutil.revrange(repo, [srcf])
+src = scmutil.revrange(repo, srcf)
 if not src:
 ui.status(_(b'empty "source" revision set - nothing to rebase\n'))
 return None
-rebaseset = repo.revs(b'(%ld)::', src) or src
+# `+  (%ld)` to work around `wdir()::` being empty
+rebaseset = repo.revs(b'(%ld):: + (%ld)', src, src)
 else:
 base = scmutil.revrange(repo, [basef or b'.'])
 if not base:



To: martinvonz, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D8293: rebase: accept multiple --base arguments

2020-03-13 Thread martinvonz (Martin von Zweigbergk)
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Same reasoning as for the previous patch. Rebase has worked well with
  `--base 'A + B'` since 51e7c83e05ee 
 
(rebase: calculate ancestors for
  --base separately (issue5420), 2016-11-28).

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D8293

AFFECTED FILES
  hgext/rebase.py
  relnotes/next
  tests/test-rebase-dest.t

CHANGE DETAILS

diff --git a/tests/test-rebase-dest.t b/tests/test-rebase-dest.t
--- a/tests/test-rebase-dest.t
+++ b/tests/test-rebase-dest.t
@@ -156,7 +156,7 @@
 
 Multiple destinations cannot be used with --base:
 
-  $ rebasewithdag -b B+E -d 'SRC^^' --collapse <<'EOS'
+  $ rebasewithdag -b B -b E -d 'SRC^^' --collapse <<'EOS'
   > B E
   > | |
   > A D
diff --git a/relnotes/next b/relnotes/next
--- a/relnotes/next
+++ b/relnotes/next
@@ -58,12 +58,12 @@
can use the new `conflictparents()` revset for finding the other
parent during a conflict.
 
- * `hg rebase` now accepts repeated `--source` arguments. For example,
-   `hg rebase --source 'A + B'` is equivalent to `hg rebase --source A
-   --source B`. This is a backwards-incompatible change because it
-   will break overriding an alias `myrebase = rebase --source A` by
-   `hg myrebase --source B` (it will now rebase `(A + B)::` instead of
-   `B::`).
+ * `hg rebase` now accepts repeated `--source` and `--base`
+   arguments. For example, `hg rebase --source 'A + B'` is equivalent
+   to `hg rebase --source A --source B`. This is a
+   backwards-incompatible change because it will break overriding an
+   alias `myrebase = rebase --source A` by `hg myrebase --source B`
+   (it will now rebase `(A + B)::` instead of `B::`).
 
  * `hg recover` does not verify the validity of the whole repository
anymore. You can pass `--verify` or call `hg verify` if necessary.
diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -822,7 +822,7 @@
 (
 b'b',
 b'base',
-b'',
+[],
 _(b'rebase everything from branching point of specified 
changeset'),
 _(b'REV'),
 ),
@@ -1187,7 +1187,7 @@
 inmemory,
 opts.get(b'dest', None),
 opts.get(b'source', []),
-opts.get(b'base', None),
+opts.get(b'base', []),
 opts.get(b'rev', []),
 destspace=destspace,
 )
@@ -1250,7 +1250,7 @@
 # `+  (%ld)` to work around `wdir()::` being empty
 rebaseset = repo.revs(b'(%ld):: + (%ld)', src, src)
 else:
-base = scmutil.revrange(repo, [basef or b'.'])
+base = scmutil.revrange(repo, basef or [b'.'])
 if not base:
 ui.status(
 _(b'empty "base" revision set - ' b"can't compute rebase 
set\n")



To: martinvonz, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D8138: phabricator: add a config knob to create obsolete markers when importing

2020-03-13 Thread mharbison72 (Matt Harbison)
Closed by commit rHGf10055b099b3: phabricator: add a config knob to create 
obsolete markers when importing (authored by mharbison72).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D8138?vs=20556&id=20787

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8138/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8138

AFFECTED FILES
  hgext/phabricator.py

CHANGE DETAILS

diff --git a/hgext/phabricator.py b/hgext/phabricator.py
--- a/hgext/phabricator.py
+++ b/hgext/phabricator.py
@@ -127,6 +127,9 @@
 eh.configitem(
 b'phabimport', b'secret', default=False,
 )
+eh.configitem(
+b'phabimport', b'obsolete', default=False,
+)
 
 colortable = {
 b'phabricator.action.created': b'green',
@@ -1734,6 +1737,8 @@
 
 if ui.configbool(b'phabimport', b'secret'):
 opts[b'secret'] = True
+if ui.configbool(b'phabimport', b'obsolete'):
+opts[b'obsolete'] = True  # Handled by evolve wrapping tryimportone()
 
 def _write(patches):
 parents = repo[None].parents()



To: mharbison72, #hg-reviewers, durin42
Cc: durin42, Kwan, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D8136: phabricator: add a `phabimport` command

2020-03-13 Thread mharbison72 (Matt Harbison)
Closed by commit rHGbbb170f9396d: phabricator: add a `phabimport` command 
(authored by mharbison72).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D8136?vs=20554&id=20785

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8136/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8136

AFFECTED FILES
  hgext/phabricator.py
  tests/phabricator/phabimport-stack.json
  tests/test-phabricator.t

CHANGE DETAILS

diff --git a/tests/test-phabricator.t b/tests/test-phabricator.t
--- a/tests/test-phabricator.t
+++ b/tests/test-phabricator.t
@@ -323,4 +323,27 @@
   $TESTTMP/repo/.hg/hgrc:*: phabricator.callsign=local (glob)
   $ mv .hg/hgrc.bak .hg/hgrc
 
+Phabimport works with a stack
+
   $ cd ..
+  $ hg clone repo repo2 -qr 1
+  $ cp repo/.hg/hgrc repo2/.hg/
+  $ cd repo2
+  $ hg phabimport --stack 'D7918' --test-vcr "$VCR/phabimport-stack.json"
+  applying patch from D7917
+  applying patch from D7918
+  $ hg log -G -Tcompact
+  o  3[tip]   aaef04066140   1970-01-01 00:00 +   test
+  |create draft change for phabricator testing
+  |
+  o  2   8de3712202d1   1970-01-01 00:00 +   test
+  |create public change for phabricator testing
+  |
+  @  1   a692622e6937   1970-01-01 00:00 +   test
+  |create beta for phabricator test
+  |
+  o  0   c44b38f24a45   1970-01-01 00:00 +   test
+   create alpha for phabricator test \x80 (esc)
+  
+
+  $ cd ..
diff --git a/tests/phabricator/phabimport-stack.json 
b/tests/phabricator/phabimport-stack.json
new file mode 100644
--- /dev/null
+++ b/tests/phabricator/phabimport-stack.json
@@ -0,0 +1,277 @@
+{
+"version": 1, 
+"interactions": [
+{
+"request": {
+"body": 
"__conduit__=1&output=json¶ms=%7B%22__conduit__%22%3A+%7B%22token%22%3A+%22cli-hahayouwish%22%7D%2C+%22ids%22%3A+%5B7906%2C+7907%2C+7908%2C+7909%2C+7910%2C+7911%2C+7912%2C+7913%2C+7914%2C+7915%2C+7916%2C+7917%2C+7918%5D%7D",
 
+"uri": 
"https://phab.mercurial-scm.org//api/differential.query";, 
+"headers": {
+"content-length": [
+"242"
+], 
+"host": [
+"phab.mercurial-scm.org"
+], 
+"accept": [
+"application/mercurial-0.1"
+], 
+"user-agent": [
+"mercurial/proto-1.0 (Mercurial 
5.3+205-75107f1aa427+20200215)"
+], 
+"content-type": [
+"application/x-www-form-urlencoded"
+]
+}, 
+"method": "POST"
+}, 
+"response": {
+"status": {
+"message": "OK", 
+"code": 200
+}, 
+"headers": {
+"expires": [
+"Sat, 01 Jan 2000 00:00:00 GMT"
+], 
+"transfer-encoding": [
+"chunked"
+], 
+"x-content-type-options": [
+"nosniff"
+], 
+"x-frame-options": [
+"Deny"
+], 
+"cache-control": [
+"no-store"
+], 
+"content-type": [
+"application/json"
+], 
+"server": [
+"Apache/2.4.10 (Debian)"
+], 
+"strict-transport-security": [
+"max-age=0; includeSubdomains; preload"
+], 
+"date": [
+"Sun, 16 Feb 2020 20:45:32 GMT"
+], 
+"referrer-policy": [
+"no-referrer"
+], 
+"x-xss-protection": [
+"1; mode=block"
+]
+}, 
+"body": {
+"string": 
"{\"result\":[{\"id\":\"7914\",\"phid\":\"PHID-DREV-u3iz5rww54i5jrsksnr3\",\"title\":\"rust-matchers:
 implement `visit_children_set` for 
`FileMatcher`\",\"uri\":\"https:\\/\\/phab.mercurial-scm.org\\/D7914\",\"dateCreated\":\"1579212591\",\"dateModified\":\"1581399130\",\"authorPHID\":\"PHID-USER-7hh4j4mpuwlnzvkapvse\",\"status\":\"3\",\"statusName\":\"Closed\",\"properties\":{\"draft.broadcast\":true,\"lines.added\":147,\"lines.removed\":5,\"wasAcceptedBeforeClose\":false},\"branch\":null,\"summary\":\"As
 per the removed inline comment, this will become useful in a future patch\\nin 
this series as the `IncludeMatcher` is 
introduced.\",\"testPlan\":\"\",\"lineCount\":\"152\",\"activeDiff

D8137: phabricator: add a config knob to import in the secret phase

2020-03-13 Thread mharbison72 (Matt Harbison)
Closed by commit rHG9bae1d1a0f4c: phabricator: add a config knob to import in 
the secret phase (authored by mharbison72).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D8137?vs=20555&id=20786

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8137/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8137

AFFECTED FILES
  hgext/phabricator.py
  tests/test-phabricator.t

CHANGE DETAILS

diff --git a/tests/test-phabricator.t b/tests/test-phabricator.t
--- a/tests/test-phabricator.t
+++ b/tests/test-phabricator.t
@@ -345,5 +345,39 @@
   o  0   c44b38f24a45   1970-01-01 00:00 +   test
create alpha for phabricator test \x80 (esc)
   
+Phabimport can create secret commits
+
+  $ hg rollback --config ui.rollback=True
+  repository tip rolled back to revision 1 (undo phabimport)
+  $ hg phabimport --stack 'D7918' --test-vcr "$VCR/phabimport-stack.json" \
+  >--config phabimport.secret=True
+  applying patch from D7917
+  applying patch from D7918
+  $ hg log -T phases
+  changeset:   3:aaef04066140
+  tag: tip
+  phase:   secret
+  user:test
+  date:Thu Jan 01 00:00:00 1970 +
+  summary: create draft change for phabricator testing
+  
+  changeset:   2:8de3712202d1
+  phase:   secret
+  user:test
+  date:Thu Jan 01 00:00:00 1970 +
+  summary: create public change for phabricator testing
+  
+  changeset:   1:a692622e6937
+  phase:   public
+  user:test
+  date:Thu Jan 01 00:00:00 1970 +
+  summary: create beta for phabricator test
+  
+  changeset:   0:c44b38f24a45
+  phase:   public
+  user:test
+  date:Thu Jan 01 00:00:00 1970 +
+  summary: create alpha for phabricator test \x80 (esc)
+  
 
   $ cd ..
diff --git a/hgext/phabricator.py b/hgext/phabricator.py
--- a/hgext/phabricator.py
+++ b/hgext/phabricator.py
@@ -124,6 +124,9 @@
 eh.configitem(
 b'phabsend', b'confirm', default=False,
 )
+eh.configitem(
+b'phabimport', b'secret', default=False,
+)
 
 colortable = {
 b'phabricator.action.created': b'green',
@@ -1729,6 +1732,9 @@
 # Evolve 9.3.0 assumes this key is present in cmdutil.tryimportone()
 opts[b'obsolete'] = False
 
+if ui.configbool(b'phabimport', b'secret'):
+opts[b'secret'] = True
+
 def _write(patches):
 parents = repo[None].parents()
 



To: mharbison72, #hg-reviewers, durin42, Alphare
Cc: durin42, Kwan, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D8293: rebase: accept multiple --base arguments (BC)

2020-03-13 Thread mharbison72 (Matt Harbison)
mharbison72 added inline comments.

INLINE COMMENTS

> rebase.py:874
>  + cmdutil.confirmopts,
>  _(b'[-s REV | -b REV] [-d REV] [OPTION]'),
>  helpcategory=command.CATEGORY_CHANGE_MANAGEMENT,

Maybe these need to be updated to `REV...` like some other commands that take 
multiple revs.  (I looked to `graft` for reference.)  I forgot to mention this 
on the previous patch.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8293/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8293

To: martinvonz, #hg-reviewers
Cc: mharbison72, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D8294: tests: make test-doctest.t automatically find files to run tests on

2020-03-13 Thread spectral (Kyle Lippincott)
spectral created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D8294

AFFECTED FILES
  tests/test-doctest.py

CHANGE DETAILS

diff --git a/tests/test-doctest.py b/tests/test-doctest.py
--- a/tests/test-doctest.py
+++ b/tests/test-doctest.py
@@ -1,10 +1,12 @@
 # this is hack to make sure no escape characters are inserted into the output
 
 from __future__ import absolute_import
+from __future__ import print_function
 
 import doctest
 import os
 import re
+import subprocess
 import sys
 
 ispy3 = sys.version_info[0] >= 3
@@ -49,46 +51,116 @@
 runner.summarize()
 
 
-testmod('mercurial.changelog')
-testmod('mercurial.cmdutil')
-testmod('mercurial.color')
-testmod('mercurial.config')
-testmod('mercurial.dagparser', optionflags=doctest.NORMALIZE_WHITESPACE)
-testmod('mercurial.encoding')
-testmod('mercurial.fancyopts')
-testmod('mercurial.formatter')
-testmod('mercurial.hg')
-testmod('mercurial.hgweb.hgwebdir_mod')
-testmod('mercurial.match')
-testmod('mercurial.mdiff')
-testmod('mercurial.minirst')
-testmod('mercurial.parser')
-testmod('mercurial.patch')
-testmod('mercurial.pathutil')
-testmod('mercurial.pycompat')
-testmod('mercurial.revlogutils.deltas')
-testmod('mercurial.revset')
-testmod('mercurial.revsetlang')
-testmod('mercurial.simplemerge')
-testmod('mercurial.smartset')
-testmod('mercurial.store')
-testmod('mercurial.subrepo')
-testmod('mercurial.templater')
-testmod('mercurial.ui')
-testmod('mercurial.util')
-testmod('mercurial.util', testtarget='platform')  # windows.py or posix.py
-testmod('mercurial.utils.dateutil')
-testmod('mercurial.utils.stringutil')
-testmod('hgext.convert.convcmd')
-testmod('hgext.convert.cvsps')
-testmod('hgext.convert.filemap')
-testmod('hgext.convert.p4')
-testmod('hgext.convert.subversion')
-testmod('hgext.fix')
-testmod('hgext.mq')
-# Helper scripts in tests/ that have doctests:
-testmod('drawdag')
-testmod('test-run-tests')
+DONT_RUN = []
+
+# Exceptions to the defaults for a given detected module. The value for each
+# module name is a list of dicts that specify the kwargs to pass to testmod.
+# testmod is called once per item in the list, so an empty list will cause the
+# module to not be tested.
+testmod_arg_overrides = {
+'i18n.check-translation': DONT_RUN,  # may require extra installation
+'mercurial.dagparser': [{'optionflags': doctest.NORMALIZE_WHITESPACE}],
+'mercurial.keepalive': DONT_RUN,  # >>> is an example, not a doctest
+'mercurial.posix': DONT_RUN,  # run by mercurial.platform
+'mercurial.statprof': DONT_RUN,  # >>> is an example, not a doctest
+'mercurial.util': [{}, {'testtarget': 'platform'}],  # run twice!
+'mercurial.windows': DONT_RUN,  # run by mercurial.platform
+'tests.test-url': [{'optionflags': doctest.NORMALIZE_WHITESPACE}],
+}
+
+doctest_indicator = '\n\\s*>>> '
+fileset = 'set:(**.py and grep("%s"))' % doctest_indicator
+
+files = subprocess.check_output(
+"hg files --print0 '%s'" % fileset,
+shell=True,
+cwd=os.path.dirname(os.environ['TESTDIR']),
+).split(b'\0')
+
+mods_tested = set()
+for f in files:
+if not f:
+continue
+
+if ispy3:
+f = f.decode()
+
+modname = f.replace('.py', '').replace('\\', '.').replace('/', '.')
+
+# Third-party modules aren't our responsibility to test, and the modules in
+# contrib generally do not have doctests in a good state, plus they're hard
+# to import if this test is running with py2, so we just skip both for now.
+if modname.startswith('mercurial.thirdparty.') or modname.startswith(
+'contrib.'
+):
+continue
+
+for kwargs in testmod_arg_overrides.get(modname, [{}]):
+mods_tested.add((modname, '%r' % (kwargs,)))
+if modname.startswith('tests.'):
+# On py2, we can't import from tests.foo, but it works on both py2
+# and py3 with the way that PYTHONPATH is setup to import without
+# the 'tests.' prefix, so we do that.
+modname = modname[len('tests.') :]
+
+testmod(modname, **kwargs)
 
-# Disabled since it requires extra modules that might not be installed.
-# testmod('i18n.check-translation')
+# Meta-test: let's make sure that we actually ran what we expected to, above.
+# Each item in the set is a 2-tuple of module name and stringified kwargs 
passed
+# to testmod.
+expected_mods_tested = set(
+[
+('hgext.convert.convcmd', '{}'),
+('hgext.convert.cvsps', '{}'),
+('hgext.convert.filemap', '{}'),
+('hgext.convert.p4', '{}'),
+('hgext.convert.subversion', '{}'),
+('hgext.fix', '{}'),
+('hgext.mq', '{}'),
+('mercurial.changelog', '{}'),
+('mercurial.cmdutil', '{}'),
+('mercurial.color', '{}'),
+('mercurial.config', '{}'),
+('mercurial.dagparser', "{'optionflags': 4}"),
+   

D8281: narrow: escape includepats/excludepats when sending over the wire (BC)

2020-03-13 Thread spectral (Kyle Lippincott)
spectral updated this revision to Diff 20789.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D8281?vs=20767&id=20789

BRANCH
  default

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8281/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8281

AFFECTED FILES
  hgext/narrow/narrowbundle2.py
  hgext/narrow/narrowwirepeer.py
  mercurial/wireprototypes.py
  mercurial/wireprotov1peer.py
  mercurial/wireprotov1server.py
  relnotes/next
  tests/test-narrow-exchange.t

CHANGE DETAILS

diff --git a/tests/test-narrow-exchange.t b/tests/test-narrow-exchange.t
--- a/tests/test-narrow-exchange.t
+++ b/tests/test-narrow-exchange.t
@@ -223,3 +223,62 @@
   remote: rollback completed (lfs-on !)
   remote: abort: data/inside2/f.i@f59b4e021835: no match found! (lfs-on !)
   abort: stream ended unexpectedly (got 0 bytes, expected 4) (lfs-on !)
+
+Test paths with commas in them
+  $ cd $TESTTMP
+  $ hg init commas-master
+  $ cd commas-master
+  $ mkdir a,b
+  $ mkdir a,b/c,d
+  $ mkdir a,b/e,f
+  $ mkdir g
+  $ echo abcd > a,b/c,d/abcd
+  $ echo abef > a,b/e,f/abef
+  $ echo ghi > g/h,i
+  $ hg ci -qAm r0
+  $ echo abcd2 >> a,b/c,d/abcd
+  $ echo abef2 >> a,b/e,f/abef
+  $ echo ghi2 >> g/h,i
+  $ hg ci -qm r1
+  $ cd ..
+
+Test that we can pull and push with a file that has a comma in the name, even
+though the commas don't appear in the narrowspec file (since they're just
+filenames)
+  $ hg clone --narrow ssh://user@dummy/commas-master commas-in-file \
+  >   --include g -qr 0
+  $ cd commas-in-file
+  $ hg pull -q
+  $ echo ghi3 >> g/h,i
+  $ hg ci -qm 'modify g/h,i'
+  $ hg push -qf
+  $ cd ..
+
+Test commas in the --include, plus pull+push
+  $ hg clone --narrow ssh://user@dummy/commas-master commas-in-dir \
+  >   --include a,b --exclude a,b/c,d -qr 0
+  $ cd commas-in-dir
+  $ hg pull -q
+  $ echo abef3 >> a,b/e,f/abef
+  $ hg ci -qm 'modify a,b/e,f'
+  $ hg push -qf
+
+Test that --{add,remove}{include,exclude} work with commas in the directory
+names.
+  $ hg tracked
+  I path:a,b
+  X path:a,b/c,d
+  $ hg tracked --removeexclude a,b/c,d --addinclude a,b/e,f -q
+  $ hg tracked
+  I path:a,b
+  I path:a,b/e,f
+  $ hg files
+  a,b/c,d/abcd
+  a,b/e,f/abef
+  $ hg tracked --removeinclude a,b/e,f --addexclude a,b/c,d -q
+  $ hg tracked
+  I path:a,b
+  X path:a,b/c,d
+  $ hg files
+  a,b/e,f/abef
+  $ cd ..
diff --git a/relnotes/next b/relnotes/next
--- a/relnotes/next
+++ b/relnotes/next
@@ -23,6 +23,10 @@
Will use `zstd` compression for new repositories is available, and will
simply fall back to `zlib` if not.
 
+ * The experimental `narrow` extension will now be able to have include or
+   exclude patterns that have a comma in the name when both client and server
+   are updated.
+
 == New Experimental Features ==
 
  * `hg copy` now supports a `--at-rev` argument to mark files as
@@ -49,6 +53,15 @@
  * `hg recover` does not verify the validity of the whole repository
anymore. You can pass `--verify` or call `hg verify` if necessary.
 
+ * The experimental `narrow` extension wireproto serialization format is
+   changing slightly. Windows clients will transmit paths with `/` as the path
+   separator instead of `\`. Any `,` or `\` in the path for include or exclude
+   patterns will be escaped. Newer servers speaking with older clients may
+   accidentally unescape paths that weren't actually escaped by the client, but
+   this is extremely unlikely to happen in practice. Newer clients speaking 
with
+   older servers will escape any `\` character and this will not be interpreted
+   properly by the server, causing the path to not match.
+
 == Internal API Changes ==
 
  * The deprecated `ui.progress()` has now been deleted. Please use
diff --git a/mercurial/wireprotov1server.py b/mercurial/wireprotov1server.py
--- a/mercurial/wireprotov1server.py
+++ b/mercurial/wireprotov1server.py
@@ -448,6 +448,8 @@
 opts[k] = list(v.split(b','))
 elif keytype == b'scsv':
 opts[k] = set(v.split(b','))
+elif keytype == b'csvpaths':
+opts[k] = wireprototypes.decodecsvpaths(v)
 elif keytype == b'boolean':
 # Client should serialize False as '0', which is a non-empty string
 # so it evaluates as a True bool.
diff --git a/mercurial/wireprotov1peer.py b/mercurial/wireprotov1peer.py
--- a/mercurial/wireprotov1peer.py
+++ b/mercurial/wireprotov1peer.py
@@ -462,6 +462,8 @@
 value = b','.join(value)
 elif keytype == b'scsv':
 value = b','.join(sorted(value))
+elif keytype == b'csvpaths':
+value = wireprototypes.encodecsvpaths(value)
 elif keytype == b'boolean':
 value = b'%i' % bool(value)
 elif keytype != b'plain':
diff --git a/mercurial/wireprototypes.py b/mercurial/wireprototypes.py
--- a/mercurial/wireprototypes.py
+++ b/mercurial/wireprototypes.py
@@ -161,6 +161,8 @@
 # :no

D8280: tests: make test-doctest.t module list match reality

2020-03-13 Thread spectral (Kyle Lippincott)
spectral added a comment.
spectral marked an inline comment as done.


  In D8280#123642 , @marmoute 
wrote:
  
  > Should we try to move to some automatic detection of file with doctest? 
That would be more reliable.
  
  D8294 , though it got a bit complicated 
:)

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8280/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8280

To: spectral, #hg-reviewers, mharbison72
Cc: marmoute, mharbison72, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D8295: rebase: mention -r argument in synposis

2020-03-13 Thread martinvonz (Martin von Zweigbergk)
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  I'm guessing that we simply forgot to mention it there. I was
  wondering if maybe `-r` was experimental as long as evolution is, but
  that doesn't seem to be the case (`-r` is not marked experimental).

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D8295

AFFECTED FILES
  hgext/rebase.py

CHANGE DETAILS

diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -871,7 +871,7 @@
 + cmdutil.dryrunopts
 + cmdutil.formatteropts
 + cmdutil.confirmopts,
-_(b'[-s REV | -b REV] [-d REV] [OPTION]'),
+_(b'[-s REV | -b REV | [-r REV]...] [-d REV] [OPTION]...'),
 helpcategory=command.CATEGORY_CHANGE_MANAGEMENT,
 )
 def rebase(ui, repo, **opts):



To: martinvonz, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D8293: rebase: accept multiple --base arguments (BC)

2020-03-13 Thread martinvonz (Martin von Zweigbergk)
martinvonz updated this revision to Diff 20792.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D8293?vs=20784&id=20792

BRANCH
  default

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8293/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8293

AFFECTED FILES
  hgext/rebase.py
  relnotes/next
  tests/test-rebase-dest.t

CHANGE DETAILS

diff --git a/tests/test-rebase-dest.t b/tests/test-rebase-dest.t
--- a/tests/test-rebase-dest.t
+++ b/tests/test-rebase-dest.t
@@ -156,7 +156,7 @@
 
 Multiple destinations cannot be used with --base:
 
-  $ rebasewithdag -b B+E -d 'SRC^^' --collapse <<'EOS'
+  $ rebasewithdag -b B -b E -d 'SRC^^' --collapse <<'EOS'
   > B E
   > | |
   > A D
diff --git a/relnotes/next b/relnotes/next
--- a/relnotes/next
+++ b/relnotes/next
@@ -58,12 +58,12 @@
can use the new `conflictparents()` revset for finding the other
parent during a conflict.
 
- * `hg rebase` now accepts repeated `--source` arguments. For example,
-   `hg rebase --source 'A + B'` is equivalent to `hg rebase --source A
-   --source B`. This is a backwards-incompatible change because it
-   will break overriding an alias `myrebase = rebase --source A` by
-   `hg myrebase --source B` (it will now rebase `(A + B)::` instead of
-   `B::`).
+ * `hg rebase` now accepts repeated `--source` and `--base`
+   arguments. For example, `hg rebase --source 'A + B'` is equivalent
+   to `hg rebase --source A --source B`. This is a
+   backwards-incompatible change because it will break overriding an
+   alias `myrebase = rebase --source A` by `hg myrebase --source B`
+   (it will now rebase `(A + B)::` instead of `B::`).
 
  * `hg recover` does not verify the validity of the whole repository
anymore. You can pass `--verify` or call `hg verify` if necessary.
diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -822,7 +822,7 @@
 (
 b'b',
 b'base',
-b'',
+[],
 _(b'rebase everything from branching point of specified 
changeset'),
 _(b'REV'),
 ),
@@ -871,7 +871,7 @@
 + cmdutil.dryrunopts
 + cmdutil.formatteropts
 + cmdutil.confirmopts,
-_(b'[[-s REV]... | -b REV | [-r REV]...] [-d REV] [OPTION]...'),
+_(b'[[-s REV]... | [-b REV]... | [-r REV]...] [-d REV] [OPTION]...'),
 helpcategory=command.CATEGORY_CHANGE_MANAGEMENT,
 )
 def rebase(ui, repo, **opts):
@@ -1187,7 +1187,7 @@
 inmemory,
 opts.get(b'dest', None),
 opts.get(b'source', []),
-opts.get(b'base', None),
+opts.get(b'base', []),
 opts.get(b'rev', []),
 destspace=destspace,
 )
@@ -1250,7 +1250,7 @@
 # `+  (%ld)` to work around `wdir()::` being empty
 rebaseset = repo.revs(b'(%ld):: + (%ld)', src, src)
 else:
-base = scmutil.revrange(repo, [basef or b'.'])
+base = scmutil.revrange(repo, basef or [b'.'])
 if not base:
 ui.status(
 _(b'empty "base" revision set - ' b"can't compute rebase 
set\n")



To: martinvonz, #hg-reviewers
Cc: mharbison72, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D8292: rebase: accept multiple --source arguments (BC)

2020-03-13 Thread martinvonz (Martin von Zweigbergk)
martinvonz updated this revision to Diff 20791.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D8292?vs=20783&id=20791

BRANCH
  default

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8292/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8292

AFFECTED FILES
  hgext/rebase.py
  relnotes/next
  tests/test-rebase-dest.t
  tests/test-rebase-parameters.t

CHANGE DETAILS

diff --git a/tests/test-rebase-parameters.t b/tests/test-rebase-parameters.t
--- a/tests/test-rebase-parameters.t
+++ b/tests/test-rebase-parameters.t
@@ -100,6 +100,10 @@
   abort: cannot rebase the working copy
   [255]
 
+  $ hg rebase --source 1 --source 'wdir()' --dest 6
+  abort: cannot rebase the working copy
+  [255]
+
   $ hg rebase --source '1 & !1' --dest 8
   empty "source" revision set - nothing to rebase
   [1]
diff --git a/tests/test-rebase-dest.t b/tests/test-rebase-dest.t
--- a/tests/test-rebase-dest.t
+++ b/tests/test-rebase-dest.t
@@ -272,7 +272,7 @@
   
 Move to a previous parent:
 
-  $ rebasewithdag -s E+F+G -d 'SRC^^' <<'EOS'
+  $ rebasewithdag -s E -s F -s G -d 'SRC^^' <<'EOS'
   > H
   > |
   >   D G
diff --git a/relnotes/next b/relnotes/next
--- a/relnotes/next
+++ b/relnotes/next
@@ -58,6 +58,13 @@
can use the new `conflictparents()` revset for finding the other
parent during a conflict.
 
+ * `hg rebase` now accepts repeated `--source` arguments. For example,
+   `hg rebase --source 'A + B'` is equivalent to `hg rebase --source A
+   --source B`. This is a backwards-incompatible change because it
+   will break overriding an alias `myrebase = rebase --source A` by
+   `hg myrebase --source B` (it will now rebase `(A + B)::` instead of
+   `B::`).
+
  * `hg recover` does not verify the validity of the whole repository
anymore. You can pass `--verify` or call `hg verify` if necessary.
 
diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -815,8 +815,8 @@
 (
 b's',
 b'source',
-b'',
-_(b'rebase the specified changeset and descendants'),
+[],
+_(b'rebase the specified changesets and their descendants'),
 _(b'REV'),
 ),
 (
@@ -871,7 +871,7 @@
 + cmdutil.dryrunopts
 + cmdutil.formatteropts
 + cmdutil.confirmopts,
-_(b'[-s REV | -b REV | [-r REV]...] [-d REV] [OPTION]...'),
+_(b'[[-s REV]... | -b REV | [-r REV]...] [-d REV] [OPTION]...'),
 helpcategory=command.CATEGORY_CHANGE_MANAGEMENT,
 )
 def rebase(ui, repo, **opts):
@@ -1186,7 +1186,7 @@
 repo,
 inmemory,
 opts.get(b'dest', None),
-opts.get(b'source', None),
+opts.get(b'source', []),
 opts.get(b'base', None),
 opts.get(b'rev', []),
 destspace=destspace,
@@ -1243,11 +1243,12 @@
 ui.status(_(b'empty "rev" revision set - nothing to rebase\n'))
 return None
 elif srcf:
-src = scmutil.revrange(repo, [srcf])
+src = scmutil.revrange(repo, srcf)
 if not src:
 ui.status(_(b'empty "source" revision set - nothing to rebase\n'))
 return None
-rebaseset = repo.revs(b'(%ld)::', src) or src
+# `+  (%ld)` to work around `wdir()::` being empty
+rebaseset = repo.revs(b'(%ld):: + (%ld)', src, src)
 else:
 base = scmutil.revrange(repo, [basef or b'.'])
 if not base:



To: martinvonz, #hg-reviewers, mharbison72
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D8293: rebase: accept multiple --base arguments (BC)

2020-03-13 Thread martinvonz (Martin von Zweigbergk)
martinvonz added a comment.
martinvonz marked an inline comment as done.


  I've updated the synopsis (also added another patch in the series for adding 
`-r` to the synopsis).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8293/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8293

To: martinvonz, #hg-reviewers
Cc: mharbison72, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D8295: rebase: mention -r argument in synopsis

2020-03-13 Thread mharbison72 (Matt Harbison)
mharbison72 added a comment.
mharbison72 accepted this revision.


  Weird, I thought this was dependent on evolve too.  But I guess if that were 
really the case, it would have be implemented in a wrapper in evolve.  I 
suppose it works without evolve if using `--keep`, but I never use that.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8295/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8295

To: martinvonz, #hg-reviewers, mharbison72
Cc: mharbison72, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[Bug 6288] New: The curses ui doesn't support word diff

2020-03-13 Thread mercurial-bugs
https://bz.mercurial-scm.org/show_bug.cgi?id=6288

Bug ID: 6288
   Summary: The curses ui doesn't support word diff
   Product: Mercurial
   Version: 5.3
  Hardware: All
OS: All
Status: UNCONFIRMED
  Severity: feature
  Priority: wish
 Component: Mercurial
  Assignee: bugzi...@mercurial-scm.org
  Reporter: matt_harbi...@yahoo.com
CC: mercurial-devel@mercurial-scm.org
Python Version: ---

I noticed this with `hg revert -i` and `ui.tweakdefaults=True` on Linux with
5.3.1.  `hg diff` shows the word diffs, so it wasn't a config issue.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel