vault history - not quoting " character

If you are having a problem using Vault, post a message here.

Moderator: SourceGear

Post Reply
rab
Posts: 18
Joined: Tue Apr 12, 2005 5:03 pm
Location: Australia

vault history - not quoting " character

Post by rab » Sun May 09, 2010 11:54 pm

Hi Sourcegear,

We are using Version 5.0.3.18802 for Client and Server.

I have noticed a problem with the Vault command client that affects CruiseControl .Net - if someone uses " (or some other special characters like a bullet point pasted in from Word) in a check-in comment - then CC.Net throws an exception while parsing the vault history output. I just ran the command line client manually and found that the " isn't quoted in the XML output.

Here is a sample:

Code: Select all

    <item txid="274524" date="10/05/2010 11:08:45" name="XYZ/ABC/File.cpp" type="60" typeName="CheckIn" version="35" objverid="2212602" user="someuser" comment="File-Control-Coord System - Fix problem:- If you turn off projection it now rememembers the last used projection, but  if you select "use predefined projection" the last used projection details are filled in but will revert back to use localization unless you have gone to the projection tab and selected the projection again." actionString="Checked In" />
Can you help please?

Regards,
Rob Barnes

lbauer
Posts: 9736
Joined: Tue Dec 16, 2003 1:25 pm
Location: SourceGear

Re: vault history - not quoting " character

Post by lbauer » Mon May 10, 2010 1:32 pm

What version of CCNet are you using?
Linda Bauer
SourceGear
Technical Support Manager

rab
Posts: 18
Joined: Tue Apr 12, 2005 5:03 pm
Location: Australia

Re: vault history - not quoting " character

Post by rab » Mon May 10, 2010 2:43 pm

Hi,

We are using version 1.4.4, this has also happenned with older versions of CC.Net too.

Regards,
Rob Barnes

lbauer
Posts: 9736
Joined: Tue Dec 16, 2003 1:25 pm
Location: SourceGear

Re: vault history - not quoting " character

Post by lbauer » Mon May 10, 2010 2:58 pm

This is a known issue when copying from Word. The problem lies with "Smart Quotes" in Word. It's an option that's on by default, and gives you the "opening" and "closing" double-quotes automatically. The trouble is, Vault stores these "quotes" in the comment as their high-ANSI equivalents, but when the CLC passes them on to be output by DOS, they get auto-converted in to the standard quote char. This causes XML to get upset.

The solution is to disable the option to replace "Straight quotes" with "smart quotes". In other words, you want to use "Straight Quotes."
In Word 2003, it is in menu Tools/Autocorrect options, it is first option in both Autoformat tabs.

In Word 2007 this setting is in Word Options->Proofing->AutoCorrect Options->AutoFormat as you Type.
Linda Bauer
SourceGear
Technical Support Manager

rab
Posts: 18
Joined: Tue Apr 12, 2005 5:03 pm
Location: Australia

Re: vault history - not quoting " character

Post by rab » Mon May 10, 2010 3:16 pm

Hi,

Just to be clear, in this instance Word is not a factor. The issue is the the user simply typed double-quote characters into his commit message as per the example that I pasted into my original post.

Regards,
Rob

lbauer
Posts: 9736
Joined: Tue Dec 16, 2003 1:25 pm
Location: SourceGear

Re: vault history - not quoting " character

Post by lbauer » Tue May 11, 2010 3:15 pm

It could be related to the encoding you're using.

To produce valid XML output, the CLC converts quotes (0x22) to " but it ignores the curlies whose char codes are U+201C and U+201D. This would be OK, except that something later in the process recognizes the curlies and converts them to 0x22. So the end result is that they get output as unescaped quotes, and XML fails.

We haven't been able to reproduce the problem with what you've posted on the forum. Could you copy your sample from the original source and paste it into Notepad, and email it to use? Send it to support at sourcegear.com, Attn: Linda. Please include a link to this forum post.
Linda Bauer
SourceGear
Technical Support Manager

rab
Posts: 18
Joined: Tue Apr 12, 2005 5:03 pm
Location: Australia

Re: vault history - not quoting " character

Post by rab » Tue May 11, 2010 5:11 pm

Linda,

You are correct about the problem being caused by pasting in opening and closing double quote special characters from Word. I just talked to the user who did the check-in and that is what he did.

I can reproduce it by creating the check-in details in Word with the offending characters and then pasting it into the Vault Client.

Regards,
Rob

lbauer
Posts: 9736
Joined: Tue Dec 16, 2003 1:25 pm
Location: SourceGear

Re: vault history - not quoting " character

Post by lbauer » Wed May 12, 2010 9:45 am

Thanks for the update. Using "straight quotes" in Word would alleviate the problem.
Linda Bauer
SourceGear
Technical Support Manager

rab
Posts: 18
Joined: Tue Apr 12, 2005 5:03 pm
Location: Australia

Re: vault history - not quoting " character

Post by rab » Wed May 12, 2010 2:41 pm

Yes that is true, and I have advised the team here to not paste from Word.

It would be nice to see a software fix for this issue in a future version.

Thanks for your help.

Regards,
Rob

lbauer
Posts: 9736
Joined: Tue Dec 16, 2003 1:25 pm
Location: SourceGear

Re: vault history - not quoting " character

Post by lbauer » Wed May 12, 2010 3:35 pm

You could try using our CCNET plugin. We've tested it and it works with items pasted from Word. You can download it from our website at:
http://www.sourcegear.com/vault/downloads.html

A Readme file with more information is included. The main change would be in your CCNET.config file. For Type= you'd use VaultPlugin instead of just Vault.
Linda Bauer
SourceGear
Technical Support Manager

Post Reply