Always apply (and hide) some patches

Arne Babenhauserheide arne_bab at web.de
Tue Jun 6 09:34:23 UTC 2017


Hi Danylo,

Danylo Hlynskyi <abcz2.uprola at gmail.com> writes:

> I'd like to add another patch layer between Working Directory and actually
> recorded commits.
>
> Similarities with Working Directory:
> - is preserved alongside with Working Directory on `hg update`
> - isn't showed as a commit in repo (in `hg log`)
>
> Similarities with regular commits:
> - changes are applied to sources
> - changes are not shown in `hg status` or `hg diff`
> - in push/pull it acts as commit in secret phase

This sounds you actually only need secret phase commits along with hooks
which graft your commit onto the most recent non-secret changeset and
then rebase your secret commits.

> More features:
> - merge, rebase, histedit, commit should all have a postHook, that rebases
> patch layer transparently
> - patch layer should have on/off switch, which converts to/from MQ, or even
> normal commits
> - another "local" entity alongside with local hgignore, local bookmarks and
> local MQ

Did you already try whether the evolve extension provides this for you?

The one complicated part I see is that you’d need to track state whether
you want to add to your secret commits or create a public commit. To
avoid having to track state, you could always add secret commits and
explicitly convert those you want public by grafting them and changing
their phase. Then you’d need to add a post-graft hook which checks
whether you just grafted a secret changeset and in that case rebases the
other secret changesets on top of it and kills the original commit you
just grafted.

You could then make an alias for that which
- records your current commit,
- updates to the latest non-secret commit,
- grafts the recorded commit, and then
- updates back to the most recent secret commit.

That way you’d just need to run a single command to make your last
commit non-secret.

Best wishes,
Arne
--
Unpolitisch sein
heißt politisch sein
ohne es zu merken
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <http://lists.mercurial-scm.org/pipermail/mercurial/attachments/20170606/abb2bdfb/attachment.asc>


More information about the Mercurial mailing list