CRC on command-line check-in

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

Moderator: SourceGear

Post Reply
daboy1216
Posts: 14
Joined: Wed Mar 09, 2005 7:59 pm

CRC on command-line check-in

Post by daboy1216 » Fri Jul 21, 2006 8:02 am

Is there any way to turn on CRC checking for command-line check-ins? We have built a utility on top of the command-line client to automatically check-in our files, but the timestamps will definitely have changed, so they're unreliable to use for determining differences.

We are using Vault 3.1.8.3177.

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

Post by lbauer » Fri Jul 21, 2006 4:14 pm

I think we already use CRCs for checkings. Are you having a problem with Command Line Client checkins?
Linda Bauer
SourceGear
Technical Support Manager

daboy1216
Posts: 14
Joined: Wed Mar 09, 2005 7:59 pm

Post by daboy1216 » Mon Jul 24, 2006 7:57 am

Yes, I think so. Let me give you some more information:

We have written a utility that uses the command-line Vault client. It checks out a file from Vault, then later overwrites the working file with a newly-generated one. Obviously, then, the modification date will be newer. However, in many cases, the newly-generated file will have identical contents to the old file. Then, the utility uses the command-line Vault client to checkin the file. According to the documentation for checkin, the default operation in the case of an unchanged file is to undocheckout. However, that's not what's happening. The file is being checked-in despite being identical to the one in Vault.

So, as you can see, we really need the command-line client to use CRC checking for check-ins.

daboy1216
Posts: 14
Joined: Wed Mar 09, 2005 7:59 pm

Post by daboy1216 » Thu Aug 03, 2006 12:49 pm

Well, since I haven't received a response to this post, I decided to take a look at the source code for the command-line client. From what I can see, it does not explicitly do any sort of CRC checking. Instead, it simply relies on the Vault API to do the comparison.

What I really want is an option on CHECKIN that would allow me to compare files using CRC--regardless of my current settings in the Vault Client. Similar to how I can pass the "-unchanged" option currently to override my Vault Client settings if I want to.

Any thoughts on when/if a feature like this could be added?

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

Post by lbauer » Thu Aug 03, 2006 3:32 pm

Vault doesn't just rely on timestamps to determine if a file has changed. The CRC handling is in the client operations libraries, rather than in the CLC code.

There's an option in the "commit" command on how to handle unchanged files:

-unchanged checkin:leavecheckedout:undocheckout

Have you tried to explicity use -unchanged undocheckout?
Linda Bauer
SourceGear
Technical Support Manager

daboy1216
Posts: 14
Joined: Wed Mar 09, 2005 7:59 pm

Post by daboy1216 » Fri Aug 04, 2006 12:30 pm

I do use the "undocheckout" option. But the command-line client seems to only use CRC checking when it's turned on in the Vault GUI Client. I don't want that. I want an option to tell the command-line client to use CRC even if it's not turned on in the GUI Client. There are other options that work for a single-use in the command-line client, but don't affect your system settings. "-unchanged undocheckout" is a perfect example.

In case anyone doesn't believe that the command-line client relies on the GUI Client's setting, follow these steps:

1) Make sure the "Use CRC" option is unchecked in the Vault GUI Client.
2) Using the command-line client, execute this command on a file:
vault checkout "$/Somefile"
3) Change the modified date on the file, but don't change the contents. Open and immediately save it or something.
4) Execute this command:
vault checkin -unchanged undocheckout "$/Somefile"
5) Notice the version number is increased in Vault even though a Diff shows that the files are identical.
6) Now check the "Use CRC" option in the Vault GUI Client.
7) Repeat steps 2-4.
8) Notice the version number is not increased in Vault. That's because the file's contents were identical.

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

Post by lbauer » Fri Aug 04, 2006 2:31 pm

I want an option to tell the command-line client to use CRC even if it's not turned on in the GUI Client.
Thanks for the detailed response.

I'll log this as a request for enhancement for a future release.
Linda Bauer
SourceGear
Technical Support Manager

christian
Posts: 202
Joined: Tue Sep 14, 2004 1:02 pm
Location: UK

Post by christian » Sat Feb 17, 2007 12:01 pm

Please add my vote for this enhancement to the command-line client

Christian

Post Reply