![]() The middle change was the most subtle: I added a single character randomly to the text. You can see that it highlights the additions in blue on the right side. My first change is a bit tougher: I turned the word "amet" into " metta world peace". My third change is the easiest to see: I added a new line. What you can hopefully see by doing your own diff is that the diff tool is great at picking out every little change that was made and displaying them to you. The green bar indicates where these changes are in the original file, and the blue bar indicates where these changes are in the new file. You can see from the red bar on the right side that KDiff3 has detected three changes across the file. (The number after the sign is the revision.) Note that there are browse buttons next to each of those, so you could diff any files that you have, regardless of whether they're under version control or not. The one on the left says and the one on the right says Design.txt. You can tell all of this by looking at the text just just about the actual files. On the right is the current state of the file. What you see on the left side is the last version that was committed to the repository. For now, I'll just cover the most important features. It has quite a few features, and we just don't have time to look at everything here, but feel free to explore. I'm not going to go into a ton of details on this tool. This opens KDiff3, preconfigured to compare your edits to the file against the last version you committed, so that you can see the changes that you made. Once you've made some changes (the file will now have a red exclamation icon overlaid on it, instead of the green check icon that indicates nothing has changed) right-click on it and choose TortoiseHg > Visual Diff. We'll use the diff tool to show the changes that were made to the file. To set things up, go to your repository and make a change of some sort to a file without committing the change right away. In this tutorial, we'll take a few minutes to explore the diff tool. You can use this tool to compare any two similar files, but the most popular use for it will be to compare a file that you've changed with the latest version in the repository to see how it's different from the last commit. ![]() ![]() TortoiseHg includes a visual diff tool called KDiff3. Diff tools are able to compare two text files (which are presumably somewhat similar) and point out what changed from one file to the other.Īll version control systems use some form of diff tool, and Mercurial is no different. How does it figure out what got edited? There's a category of software programs called "diff tools", or "diff utilities", named after the original: a program on Unix systems from a very long time ago. Perhaps by now you're wondering how Mercurial knows what changes have been made in your code.
0 Comments
Leave a Reply. |