Ability to emulate crecord-style exclude line from commit
Created originally on Bitbucket by Retributive Tribulation (Raif Atef)
Hello TortoiseHg team,
I didn't find this reported, so I thought I might enter it here lest a gently generous soul find it in his/her heart to implement it.
This is related to bug: #3251 in that it reduces the need for that bug to be implemented if this one is easier to be done.
It could work like this:
-
Basically, let us right-click on a line in the middle of a hunk and choose "exclude this line from the next commit".
-
TortoiseHg would save in memory of the commit dialog (or maybe somewhere accessible globally for the current revision) the line number (and perhaps a hash of the first 1024 chars or line content in case the file changes outside the commit dialog).
-
When the user chooses to commit, TortoiseHg would recheck the file at the specified line, redo the hash to make sure the line didn't change, and then backup the original file, create a new file without the line, and then commit, then restore the backup.
-
I realize a potential difficult point is how the hg diff detector would change the hunk layout when a line is removed (it may merge 2 hunks), but that can be remedied by showing the user the UI based on the file being already altered, so the user can effectively choose from the "future hunk".
Well, just my 2 cents, maybe someone more experienced than me can pitch in or at least tell me why it is a bad idea :-)