What happened to 'Change Selection' in the commit dialog?

Create issue
Issue #188 resolved
Jay Graves created an issue


This was so easy and nice. I tried to use the 'shelve' functionality but it wouldn't re-apply my shelved change.

Was this functionality removed or just not made it to 2.0 yet?

Comments (35)

  1. Laurens Holst

    First of all congratulations on your 2.0 release.

    It’s too bad though that it does not include chunk selection. This was really a killer feature of TortoiseHg that set it and Mercurial apart from its competitors. I’m very glad to hear that this feature is still on the wish list and wasn’t intentionally removed.

    When you say that we need to wait for in memory patching in core, does that mean it’ll take at least 3 months before we can get it? I don’t suppose it would be feasible to retrofit the old chunk selection into thg before then?

    I read in another place that you’re also going to update the old hgtk to Mercurial 1.8, I think this means I’ll have to install that one for the time being. I’m simply using this feature too much to miss it for that period of time. Thanks for still supporting the old hgtk project.

  2. Steve Borho

    I don't consider it feasible to back-port the hgtk style chunk selection into the 2.0 commit tool, especially as an interim solution.

    It may be 2.1 before I even contemplate adding this. There's quite a bit of infrastructure cleanup that needs to be done before I add some deeply complex code.

  3. Kevin Turner

    This is one of the top features I look for in selecting a VCS UI, and the primary reason I use thg over, say, emacs's dvcs. I use this a lot.

    It might be worth it for me to throw some development time at this, if there's any part of it (either on the hg side or thg) that you feel like you can delegate.

    (although the fact that hunk selection still exists in shelve makes this perhaps less urgent for me than I thought.)

  4. Steve Borho

    Knock yourself out :)

    My vision for how this will be integrated is for the HgFileView class to have a fourth "mode" after diff, file, and annotate. The fourth mode would offer chunk selection just as it's implemented in the shelve tool. The chunk mode button would only be visible if the fileview is handling a workingctx, like the shelve button, and would only be sensitive when the diff button is sensitive (when file diffs are available). Bonus points if you allow chunks to be reverted without adding more buttons.

    The commit tool currently keeps no state per file, so that would have to be added, and it would have to handle refresh events cleanly.

    At commit time, I would prefer for the commit to be done using a memctx, reading files from disk if they are not chunk-selected and building tempfiles for the files that are chunk-selected (thus entirely avoiding the backup / revert / patch / recover cycle). We also have to handle renames, subrepos, hooks and everything else Mercurial does when you use the command line API.

  5. Steve Borho

    Thinking this through a little further, I think this plan of action makes the most sense:

    1) submit patches to Mercurial for hgext/record.py, switching it to use a memctx to perform the commits and using tempfiles to avoid modifying the working copy.

    2) submit further patches to hgext/record.py that allows the commit to be triggered externally by passing a dictionary that maps wfile names to chunks or to True (indicating the entire file is to be committed).

    3) Modify HgFileView as described in comment #5 and use this new record.py interface to make commits if any files are chunk-selected.

  6. Cédric Ochs

    Hi there,

    Thanks a lot for this great 2.x release, but I agree with all comments above.

    I switched all my projects from SVN to Hg especially for this feature (chunk selection) which is, for me, one of the best features of TortoiseHg.

    I just have to wait if it's on a TODO list :)

    Thanks :)

  7. Former user Account Deleted

    One thing that would be very very useful: when adding this, please not only concentrate on selecting single chunks, but go down to the granularity of selecting single lines of code. I loved this feature when using git in the past. Being able to select chunks is very important for me, so please add this :-)

    Anyway, even with chunks I still sometimes have to manually edit my file to separate one chunk into 2+. So, selection granularity on a line by line basis would be the best!

  8. Former user Account Deleted

    +1 for reimplementing hunk selection rather than later. I'm so used to it now, I won't even consider using a version control system that doesn't support it.


  9. Ibrahim Awwal

    Ah, I was wondering about this too, new to TortoiseHG and was confused by help files from old versions that had this feature. By the way though, do you guys know that you can do basically this from the command line with the record extension? It works similarly to "git add -i" for those of you who know git.

  10. Former user Account Deleted

    +2 (from my colleague and me). This is the single most important feature for me (followed by check in of 'whole' files, followed by history browsing).


  11. Former user Account Deleted

    Steve, any progress on this? You have told about THG 2.1. We can wait forever for mercurial support of this feature.

  12. Eugene Kirpichov

    This was an immensely important feature for me too. I think I'll have to roll back to an older version where it was present...

  13. Matt Oswald

    I'm going to go ahead and bump this issue as well. I think 2.0 was a massive improvement but for this one missing feature.

    I've got four "yeah!" responses from my co-workers, too. :)

  14. Jeremiah Dodds

    Thanks, Matt.

    I work at a place where the majority of people utilizing hg do so through TortoiseHg, and many of them rely on this feature. It's been holding us back from updating for a while now.

  15. Eric Palmitesta

    Didn't realize this was missing from 2.x, otherwise my team would have stayed with 1.x. It's funny how one can rely on a feature without realizing it, and as soon as it's gone it becomes massively important.

    +1 from basically our whole company on this issue :)

  16. David Sankel

    I don't know if this is the appropriate place to ask this question, but if some of us pooled together some money to pay for this feature to be implemented sooner rather than later, would that be possible?

  17. Benoît Allard

    Although I'm also eagerly waiting for this one, I do have to mention that there actually is a workaround ...

    The solution, I discovered it lately is to use the "shelve" extension integration in tortoisehg. This one gives the possibility to shelve only chunk of files. Which means that if, just before a commit, you shelve out everything you don't want, your commit will include only the remaining part of the files ... After the commit, shelve back your remaining changes, or only the one for the next commit, and so on ...

    Now if someone stands up and integrate the shelve dialog inside the commit one, there are free beers waiting for him ... just sayin' ...

  18. Matt Oswald

    Yeah, the problem is that in version 1.x, that functionality was right there in the commit window, it wasn't a couple of clicks away...

  19. abudden

    Another '+1' for this feature (especially with line-by-line selection as well as hunk selection). Git GUI implements this fairly nicely (including line-granularity), but you have to use Git for that! Although hg record can be used (at a hunk level only at the moment: my submitted patch for line-by-line appears to be going nowhere), this is somewhere that a GUI is much much better.

  20. Former user Account Deleted

    I't been more than a year now, THG is at version 2.3 and Mercurial at 2.1 and still nothing seems to have been done to address this. This is a killer for everyone who tries to do granular commits, and it is disappointing that not even the workaround (via shelve) made its way into the commit tool for bridging the time until the required HG API is available.

  21. Former user Account Deleted

    It was a great tool. But without this feature it's time to find another one or just go back to command line. Too bad...

  22. abudden

    For those interested in line-by-line commit (rather than chunk commit): in the next version of Mercurial (2.2, which is due for release shortly) the record extension will support command-line line-by-line commit.

    It would be fantastic if this could be supported in the GUI as well...

  23. Steve Borho

    the new change selection feature in thg is already better than hgtk's change selection in many ways; and it will be further improved in later releases

  24. Jaakko Vuori

    Thank you very much for this feature! I have used it several times today and I have to say that the usability is great.

    Do you have any plans to add support for "visual diffing" only the selected changes? (I.e. the changes that are really about to be checked in.)

  25. Log in to comment