[PATCH 2 of 2] qseries: add --edit option for editing .hg/patches/series

Brendan Cully brendan at kublai.com
Sat May 1 00:22:41 UTC 2010


On Saturday, 01 May 2010 at 02:16, Mads Kiilerich wrote:
> >
> >On Thursday, 29 April 2010 at 21:54, Dirkjan Ochtman wrote:
> >>On Thu, Apr 29, 2010 at 13:31, Martin Geisler<mg at aragost.com>  wrote:
> >>>Verify that the file can still can be parsed and that the user hasn't
> >>>reordered patches that are currently applied. Something like that.
> >>That sounds nice, but I'd be happy to just take this for now and have
> >>that added later.
> >>
> >>>I don't know what would be a good command line interface for this.
> >>I think it's not very trivial, and I think just invoking the editor on
> >>series is kind of nice and simple.
> >I don't think I agree. It's pretty easy to screw up your patch series
> >by misediting the series file. Adding this flag encourages monkeying
> >with the file.
> >
> 
> But ... sometimes the series file has to be monkeyed anyway. The
> proposed qpush --move might be usable in some situations, but it is
> not an efficient and sufficient UI for all tasks.

When it's necessary, it can be done just by editing
.hg/patches/series. My feeling is that if we provide a command for it,
it's the command's responsibility to only allow sensible changes.

> >I think the editor ought to launch on a _copy_ of the series file, and
> >verify after editing that the series file contains the same set of
> >patches that it did before, and that no applied patches have changed
> >order, at the very least.
> 
> That would be easy to add, but sometimes other changes than
> reordering are done, so I'm not sure it would be nice to work with.
> Examples could be to disable patches by prefixing them with # (which
> often is simpler than using guards), or to mass-remove or -add
> guards.

Guards changes could be verified using the existing guard code.

> And what should it do after an invalid edit? Just drop the changes?
> Prompt the user and open the editor again?

I think it should print out the errors and then open the editor
again.


More information about the Mercurial-devel mailing list