mrcrowl/vscode-hg

Show status and diffs of current commit as compared with immediate ancestor

Opened this issue · 7 comments

When I'm working on a feature bookmark, I will amend often while developing before sending the final version of the commit off for review.

Right now the extension only shows uncommitted files and diffs but it would also be useful to see the already committed files in draft commits when compared with their immediate ancestor.

Hi @melink14,
We have 'Hg - Log...' commands which do what you are requesting. You can explore any commit on current branch/default branch/entire repository and check what files have been modified and the modifications with respect to their immediate ancestor.

Thanks for the response and your recent work on the extension! I had to play with it a bit but was able to understand fairly quickly. I wouldn't have thought to look there since I was associating the features with different commands than log. This should be fine 90% of the time so the rest is just stretch goal ideas.

It'd be nice if a reasonable log view could always be present in the UI though maybe that would require something like 'Git lens' and is out of scope.

Right now I keep a terminal window open with an auto refreshing custom git log command for understanding the shape of my changes. I wonder if we could use the newish terminal link handler API to allow clicking on commits from terminal log commands. That would probably still be faster than crafting st and diff commands manually.

If the graph of commits isn't linear it is harder to see the topology from the Hg - Log output. That's pretty hard to do though and once again git has a completely separate extension for it (Git Graph)...

This got a bit tangential so we can close this given the original question was answered. Thanks!

One other comment: Before a push/PR I usually want to do a final check of my commit. The flow of having to run the log command and click twice for each file in the commit is a but cumbersome though I'm not sure if it's possible to open all the diffs at once via a command...

@melink14 would it be beneficial to your flow to add a "View all" or "Open all changes" in the hg log commit menu? (I'm not sure this can be implemented, but I have experienced this difficulty as well)

Yeah, something like that would definitely reduce the pain. (sorry for the late reply)

I also was thinking about the larger problem of losing context as soon as one commits again and was wondering if a way to specify relative revset would be useful, especially in the case where the source panel is otherwise empty due to no working changes.

  • Add an option to make commands relative to parent if there are no working changes. This could be extended to a general command that just took a revset for adding to log/diff commands but generally I want to go to last commit or last bookmark...

Sweet! I didn't know Hg - Log... was here.

I usually have a similar workflow, where I continuously amend a draft commit and want to double-check compared to the immediate parent. The hg log does provide a work-around, though is a bit cumbersome, particularly if there are multiple files. Ideally we would be able to set a specific commit to compare to for the Source Control view.

Taking a stab at this.