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

jaywgraves avatarjaywgraves created an issue

http://tortoisehg.bitbucket.org/manual/1.0/commit.html#change-selection

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. Anonymous

    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. Anonymous

    +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.

    Lachlan

  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. Anonymous

    +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).

    Axel

  11. 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. :)

  12. 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.

  13. 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 :)

  14. 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?

  15. 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' ...

  16. 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.

  17. Anonymous

    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.

  18. Anonymous

    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...

  19. 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...

  20. 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.)

  21. Log in to comment
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.