I am using Mercurial Shelve extension to shelve changes from command line. It works nice except when the changes that i like to shelve contain new added files(a) in working directory. Basically, it shelves everything except the new added files. I checked this by looking at the .hg/shelve stored changes.
How to shelve new added files (a status)?
Description. The "hg shelve" command saves changes made to the working directory and reverts those changes, resetting the working directory to a clean state. Later on, the "hg unshelve" command restores the changes saved by "hg shelve".
Shelve changesIn the Commit tool window Alt+0 , right-click the files or the changelist you want to put to a shelf and select Shelve changes from the context menu. In the Shelve Changes dialog, review the list of modified files.
The term 'shelve' references a commonly understood process that takes some temporary file changes, saves them locally and outside of the current version control system and then returns to those files at some point in the future. This concept is built right into the Git tool, but it's not named shelve.
This response is overdue, but you can use the following command to shelve all files (track / untrack) :
hg shelve -A
or
hg shelve --addremove
About this command, documentation says :
mark new/missing files as added/removed before shelving
You must pay attention by using this feature because after unshelving, your old untracked files are track. These file are already to be commited in the last commit if no files are specified in hg commit command. You should use hg forget if you want untracked them again.
I assume you are talking about currently untracked files? You need to add the first.
So just do hg add
for your new files and then hg shelve
will also shelve them.
Thank you Tom. I am using Mac, so it didn't really worked. What did work was another mercurial extension 'hgattic' about which you can read more in my blog
http://margotskapacs.com/2012/10/shelving-uncommitted-changes-in-mercurial/
(see section 'Bug – Added Files Unable Shelve')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With