SVN diff detailed

Source: Internet
Author: User
Tags mime file

UI version:

If more than one person edits the same piece of code, it is often prone to conflicting situations:

If there is a conflict, how can we solve him?

1 can choose to use their own files MIME file, you can also use their files their file

2 resolve conflicts, not escape. You can edit the Mergerd section directly:

Finish editing, then select "Marked as resolved" to

The circle represents a blank line,

-Represents the content of the version on the left

+ Indicates the content of the right version

<=> represents moving content, which doesn't really work.

The gray part indicates that there is no original.

(left) Chu red represents the modified content,-this must be a modification instead of a new ———— this will only appear on the left, that is, the modified part.

Orange indicates empty lines or empty content

Yellow (or not know if it can be said to be light yellow) represents new or modified content. -Yes, this time includes additions and modifications.

Light purple means that there is no change in the modified line--no light purple is added.

White, of course, indicates that nothing has changed in the part

Red: Indicates a conflict, usually red on both left and right.

Summary, in addition to the black font color,

The colors that may appear on the left (original file, or new file) are:

The colors mentioned above are likely to appear

The colors that may appear on the right (new file) are:

White

Yellow yellow, which indicates the content of the change, in words (the word inside is the variable name of Java). , ; /'; ' as the delimiter.

Light Purple

Grey

Red

It can be seen that the SVN diff function is not perfect, compared, often appear inaccurate, such as

Below is a text version of the diff description, refer to: http://www.xuebuyuan.com/2028115.html

after the end of the conflict Resolution section, the contents of our MAIN.C file are as follows1#include <stdio.h>2#include"add.h"  3#include"Sub.h"  4  5 intMain ()6 {  7printf"5 + ten =%d.\n", Add (5,Ten)); 8printf"15-10 =%d.\n", Sub ( the,Ten)); 9         //Kris ' s test Tenprintf"Kris:12 + =%d.\n", Add ( A, -));  One         //Sally ' s test  Aprintf"sally:60-33 =%d.\n", Sub ( -, -));  -         return 0;  -below, we make some changes, specifically as follows1#include <stdio.h>2#include"add.h"  3#include"Sub.h"  4  5 intMain ()6 {  7printf"5 + ten =%d.\n", Add (5,Ten)); 8printf"15-10 =%d.\n", Sub ( the,Ten)); 9         //Kris ' s test Tenprintf"kris:32 + =%d.\n", Add ( +, -));  Oneprintf"kris:15-10 =%d.\n", Sub ( the,Ten));  A         //Sally ' s test  -printf"sally:60-33 =%d.\n", Sub ( -, -));  -         return 0;  theafter the modification, call the SVN diff command, which will have the following output, and then say the meanings of the parts in the output. [Email protected]:/home/kris/calc/trunk# svn diff main.cindex:main.c===================================================================---main.c (revision8)+++main.c (Working copy) @@-7,7+7,8@@ printf ("5 + ten =%d.\n", Add (5,Ten)); printf ("15-10 =%d.\n", Sub ( the,Ten)); //Kris ' s test-printf ("Kris:12 + =%d.\n", Add ( A, -));+ printf ("kris:32 + =%d.\n", Add ( +, -));+ printf ("kris:15-10 =%d.\n", Sub ( the,Ten)); //Sally ' s testprintf"sally:60-33 =%d.\n", Sub ( -, -)); return 0Index:main.csvn diff can view all the modified files in the current working copy, and the diff output portion of each file is differentiated by the form of Index: file name. The content behind the equals sign is about the diff case of the main.c file. ---main.c (revision8)+++main.c (Working copy)---the first is the original file, which is the latest version in the Repository, or it is understood to be a modified file+++the beginning is the target file, this is your modified version @@-7,7+7,8@@ here.-and + represent the original and target files, respectively,7, 7 means 7 lines starting from line 7th,-7, 7 is the original file from the 7th line beginning of the 7 lines of content, +7, 8 means similar, indicating that the target file starts from line 7th in the 8 line of content. It is understood that there is a difference between the 8 rows of the target file starting at line 7th and the 7 lines of content starting from line 7th of the original file, printf ("5 + ten =%d.\n", Add (5,Ten)); printf ("15-10 =%d.\n", Sub ( the,Ten)); //Kris ' s test-printf ("Kris:12 + =%d.\n", Add ( A, -));+ printf ("kris:32 + =%d.\n", Add ( +, -));+ printf ("kris:15-10 =%d.\n", Sub ( the,Ten)); //Sally ' s testprintf"sally:60-33 =%d.\n", Sub ( -, -)); return 0This is the exact difference, the front-number indicates the line that needs to be deleted from the original file, and the + sign indicates the line to be added in the destination file, the part that starts with the original file only, +The part that starts with the number belongs to the target file, and the rest is the same part. 7   1   1printf"5 + ten =%d.\n", Add (5,Ten)); 8   2   2printf"15-10 =%d.\n", Sub ( the,Ten)); 9   3   3         //Kris ' s test Ten   4-printf ("Kris:12 + =%d.\n", Add ( A, -));  One       4+ printf ("kris:32 + =%d.\n", Add ( +, -));  A       5+ printf ("kris:15-10 =%d.\n", Sub ( the,Ten));  -   5   6         //Sally ' s test  -   6   7printf"sally:60-33 =%d.\n", Sub ( -, -));  the   7   8         return 0; To learn more about @@-7,7+7,8@@ the meaning of the above, with the line number and other information, the number of the first column is the line number, the following two columns of the number indicates the first line. After the callout can clearly see the original file line 7th start 7 lines and the target file 7th line beginning of 8 lines of content.

SVN diff detailed

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.