CRC on command-line check-in
Moderator: SourceGear
CRC on command-line check-in
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.
We are using Vault 3.1.8.3177.
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.
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.
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?
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?
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?
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
SourceGear
Technical Support Manager
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.
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.