output file difference and type
Moderator: SourceGear
-
- Posts: 5
- Joined: Thu Jun 09, 2005 2:12 pm
output file difference and type
Is there a way to compare the current vault file with the previous and output only the differences?
ie: line 235: added: string s = "this is an added line"
I have looked through posts and the API, but nothing sticks out.
thanks,
ie: line 235: added: string s = "this is an added line"
I have looked through posts and the API, but nothing sticks out.
thanks,
If you're willing to dig into the client API, you could try using the Blame function to get close.
http://weblogs.asp.net/jeremy_sheeley/a ... 12/15.aspx
http://weblogs.asp.net/jeremy_sheeley/a ... 12/15.aspx
-
- Posts: 5
- Joined: Thu Jun 09, 2005 2:12 pm
I think that my article wasn't clear about what blame does in general, as opposed to the purpose I put it to for the example code. Blame on the server loads the last 20 versions (by default) of a file and compares them, noting which version was the last to touch a particular line, along with the user and comment for that version. This won't tell you if the line was added versus deleted, but it will give you a line by line history of the file.
As for the example, blame does not use a regex. The example code used a regex to parse the output of a build to find out which line failed to build. The line number was then fed to blame to determine who the last user to change that line was.
You can see a graphical representation of blame in the GUI client by selecting a file and choosing Show Blame from the View menu.
Blame is built off the SGDiff library, which ships with Vault. You could use SGDiff to analyze the two versions of a file and report back lines added/deleted/changed. You would need to download the two versions to a place on disk first.
As for the example, blame does not use a regex. The example code used a regex to parse the output of a build to find out which line failed to build. The line number was then fed to blame to determine who the last user to change that line was.
You can see a graphical representation of blame in the GUI client by selecting a file and choosing Show Blame from the View menu.
Blame is built off the SGDiff library, which ships with Vault. You could use SGDiff to analyze the two versions of a file and report back lines added/deleted/changed. You would need to download the two versions to a place on disk first.
-
- Posts: 5
- Joined: Thu Jun 09, 2005 2:12 pm
-
- Posts: 5
- Joined: Thu Jun 09, 2005 2:12 pm
ok, im with you so far. I am able to get the VaultBlameNodes returned which includes the person, # of lines, first/last lines, etc....
Now is there any easy way to extract the actual content of those lines?
so I could have
308 string s = "hello"
309 ' This is a comment that was added (or removed)
Thanks in advance.
Now is there any easy way to extract the actual content of those lines?
so I could have
308 string s = "hello"
309 ' This is a comment that was added (or removed)
Thanks in advance.