Break a piece in hg; tolerance change

I use the hunk-by-hunk or hunk selection method to perform: instead of commuting all the changes made to the file, I commit the related parts. For instance. I wrote a function and test compiled to ensure it is working, and then passed the function and test separately. For this, I use the built-in functions in tortoiseHg and RecordExtention when on the console.

Now I have two changes, separated by only one constant line, and thus fall into hg tolerance of one hunk. At the moment, I want to make only the first. How?

+6
source share
1 answer

The recording extension does not allow you to split pieces further, but CRecord does a less standard extension .

Just to put it this way, but what you do is usually considered bad practice because it ensures that you do not run unit tests on files as they are done. This, of course, does not apply in all environments.

If the reason you leave some incomplete parts is because they are local changes that you always have in place (passwords, paths, etc.), they are a good candidate for the Mercurial Queues patch. Then you can “pull” them out, lock the entire file and then click them again.

+2
source

Source: https://habr.com/ru/post/953785/


All Articles