This is an archive of the discontinued Mercurial Phabricator instance.

shelve: add `update --shelve` if shelve extension is loaded
Needs RevisionPublic

Authored by pulkit on May 9 2019, 7:41 AM.

Details

Reviewers
durin42
Group Reviewers
hg-reviewers
Summary

A lot of times, I need to update to some other cset with dirty working
directory. Good number of times, I run hg shelve and hg update in order.

Let's add --shelve flag to hg update which will shelve wdir changes before
running the update.

.. feature::

`--shelve` flag to `hg update` if shelve extension is enabled. The flag will
shelve working directory changes before performing update.

Diff Detail

Repository
rHG Mercurial
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

pulkit created this revision.May 9 2019, 7:41 AM
martinvonz added inline comments.
tests/test-shelve.t
1177

It's not clear that this is related to --shelve. Can we instead first check if the working is dirty? Or make this message more explicit. The former seems better if you think users (including you) will want to set defaults.update=--shelve.

Should this abort if subrepos are present, since you can't shelve a subrepo? No -S is available on update, but maybe looking for .hgsub with any contents is good enough?

I don't have time to play with it right now, but I know updating a dirty repo with dirty subrepos is massively confusing already.

Should this abort if subrepos are present, since you can't shelve a subrepo? No -S is available on update, but maybe looking for .hgsub with any contents is good enough?

On second thought, maybe just check for dirty subrepos so that this isn’t completely incompatible with subrepos.

durin42 requested changes to this revision.Jun 12 2019, 12:17 PM
durin42 added a subscriber: durin42.

I like where this is going, but agree we should add a dirty-subrepos check so this doesn't burn subrepo users.

This revision now requires changes to proceed.Jun 12 2019, 12:17 PM