Search code examples
mercurialtortoisehg

How to keep local changes in Mercurial and make it "invisible"


In my local repo, I have a file A and I made some changes. But I didn't want to submit this changes to remote repo. The question is if I didn't submit this changes in TortoiseHG, everytime I changed other files, A will be listed in the "changelist window".

I know, TortoiseHG has a shelve function. It can store temp files. But files in shelve will revert to origin status.


Solution

  • Consider using Mercurial patch queues to manage local changes. With MQ you can queue up local changes and stash them out of the way for future use.

    For the extension's documentation, here's the standard workflow you'd use for putting away local changes for future use:

    $ hg qnew choosename
    $ hg qpop
    $ # ...
    $ # restore
    $ hg qpush
    $ hg strip -k choosename
    $ hg qremove choosename
    

    There's also shelve, but I've never used it.