Undo checkout option on command line no effect

If you are having a problem using Vault, post a message here.
Post Reply
Carl
Posts: 12
Joined: Tue Dec 28, 2010 4:41 pm

Undo checkout option on command line no effect

Post by Carl » Thu Dec 29, 2016 1:19 pm

The GUI client works fine if you've set the option to undo checkout when checking in an unchanged file.

But I haven't got it to work from the command line or the API library. A command line of this form will cause a checkin to be logged just as if the -unchanged option were not present:

Code: Select all

vault checkin -host xxx -user yyy -repository zzz -unchanged undocheckout "$/Item path"
I get the same behavior using the library method

Code: Select all

ServerOperations.ProcessCommandCommit(ItemPaths, UnchangedHandler.UndoCheckout, ...)
What am I missing that I need to make these work?

Vault 9.1.0 on 64 bit Windows 10.

Thanks,
Carl

Beth
Posts: 8550
Joined: Wed Jun 21, 2006 8:24 pm
Location: SourceGear
Contact:

Re: Undo checkout option on command line no effect

Post by Beth » Thu Dec 29, 2016 4:30 pm

Do you have the 2.0 or 3.5 .Net framework installed?
Beth Kieler
SourceGear Technical Support

Carl
Posts: 12
Joined: Tue Dec 28, 2010 4:41 pm

Re: Undo checkout option on command line no effect

Post by Carl » Thu Dec 29, 2016 6:12 pm

Yes, both of those frameworks are installed.

Beth
Posts: 8550
Joined: Wed Jun 21, 2006 8:24 pm
Location: SourceGear
Contact:

Re: Undo checkout option on command line no effect

Post by Beth » Fri Dec 30, 2016 2:40 pm

I can't replicate the behavior yet, so I will have more questions.

Is there a Vault GUI client on the same machine? If so, what do you have set in the Vault Tools - Options - Check In/Branch - Check in unchanged files?
Beth Kieler
SourceGear Technical Support

Carl
Posts: 12
Joined: Tue Dec 28, 2010 4:41 pm

Re: Undo checkout option on command line no effect

Post by Carl » Tue Jan 03, 2017 12:49 pm

I have the GUI set to "Check in unchanged files" = "Undo Check Out" and it works the way I said.

I discovered more info. Everything works as expected if you just check out the file and don't touch it. The discrepancy occurs if you rewrite the file with identical content. It will then show up as "Edited" in the GUI. If you check in from the GUI, the checkout is undone but if you use the other methods the file will be checked in.

Is the GUI client perhaps doing extra work to diff the files and decide to undo if they're identical?

The command line client produces different output in these two cases, shown below.

Thanks!
-- Carl

Output from the untouched file:

Code: Select all

<vault>
  <changeset />
  <!--Undoing check out of file $/Carls Tests/MakeWix/TODO.txt-->
  <result>
    <success>True</success>
  </result>
</vault>
And now from the rewritten but identical file:

Code: Select all

<vault>
  <changeset>
    <ModifyFile>
      <id>0</id>
      <repospath>$/Carls Tests/MakeWix/TODO.txt</repospath>
      <localpath>C:\Users\carl.clawson\Projects\Scratch\Carls Tests\MakeWix\TODO.txt</localpath>
    </ModifyFile>
  </changeset>
  <!--Preparing data to begin transaction-->
  <!--Beginning transaction-->
  <!--    Check in $/Carls Tests/MakeWix/TODO.txt-->
  <!--Ending the transaction-->
  <!--Transaction completed successfully-->
  <result>
    <success>True</success>
  </result>
</vault>

Post Reply