TF command line checkin

I am trying to update our old vss command line scripts to be used with Team Foundation Server.

I have successfully tested the tf get , tf label and tf checkout commands.
However when I run the tf checkin command it returns 'No files checked in'

I am using this command line:

tf checkin /comment:"Doing a new build" /override:"Build process commandline checkin" /noprompt

On the screen I am seeing the check in policies that are not being meet (in yellow), then a line saying policies have been overriden (in blue) then 'No files checked in'.

If I just type tf checkin and go through the GUI the files are checked in.

Am I missing something or is this a bug

Thanks,
John Ames


Answer this question

TF command line checkin

  • ly4587

    Well, there's actually no way to override required check-in notes.  They must always be specified.  So, /override only applies to check-in policies.

    Buck

  • Rasmus Foged

    Just curious as to why the /override does not resolve the need to a check in policy Note.

  • cptkhoa

    version file change by incrementing build version .. 6.3.1205 to 6.3.1206

    prebuild6.1.bat change one line
    tf get /recursive  to tf get /recursive /force

    If I run through the GUI .. just run tf checkin
    I can enter a comment, override the checkin policies and the files check in.

    In our automated build processes we check out a Version file, increment the build number then check in the Version file. That is the only command line checkout / check in that happens during a build process.  I will need to show this works before we can start implementing TFS across all out Source code branches.  

  • Yasir Godil

    John, I've tried to repro this, but I can't.  I'll need some more details.  Would you run "tf status" and then your checkin command specified above and post the full output of both   With no arguments and /noprompt, checkin should have checked everything in.

    Buck

  • AnhTin

    No, I don't think this is possible from the command line. You can find documentation of the .Net object model here: http://blogs.msdn.com/buckh/archive/2006/08/12/tfs_api_links.aspx

  • MFred

    Did you have actual changes in those 2 files with edits pended   Any "useless" edits (you pended the edit, but didn't make any actual change in the content or encoding) aren't committed in Team Foundation, and that would cause this kind of situation. 

  • cMassie

    Hello!

    I'm trying to automate tf checkin without overriding the default check-in policy. Is there any way to associate a work item with the pending change using command line I couldn't find anything in the documentation. In this forum, I only could find an advise "use object model instead of scripting tf", which sounds pretty vague for me.

    I appreciate any helpful advise.

    Thank you,

    Eugene Bruk


  • Mike Ajao


    Here is the output.

    C:\Lighthouse6.1>tf status
    File name       Change Local path
    --------------- ------ --------------------------------------------------------
    $/pcs_newdev_v6
    prebuild6.1.bat edit   C:\Lighthouse6.1\prebuild6.1.bat
    version         edit   C:\Lighthouse6.1\version

    2 change(s)

    C:\Lighthouse6.1>tf checkin /comment:"Doing a new build" /override:"Build proces
    s commandline checkin" /noprompt
    TF10117: The following check-in note does not pass check-in requirement:
      Comments: A value must be specified for the check-in note.

    TF10139: The following check-in policies have not been satisfied:
      You must associate this check-in with one or more work items.

    The policies have been overridden.


    No files checked in.



  • Allen Hovsepian

    I see the problem.  The first error message mentions that the required check-in notes have not been specified.  It's not as obvious as it could be since it's actually the first message.

    To specify check-in notes, use the /notes option.  They are of the form name=value.

    Here's an example.
       /notes:"Code reviewer=Jim,Jane;Security reviewer=Alice,Bob"

    You could also specify them in a file, with name=value on each line.

    Here's an example where the following text is in notes.txt.
    Code reviewer=Jim,Jane
    Security reviewer=Alice,Bob

    Then specify /notes:@notes.txt.

    If you have an equals sign in the field name (not common), you'll need to double it (write ==).  If you have a semi-colon in the value, it will need to be doubled too (replace ; with ;;).

    Buck

  • Alex Novosad

    Like Buck says, there's no way to override the need for a checkin note (you can change them so that note isn't required if you want).  The checkin notes aren't associated with the checkin policies, and /override is strictly about overriding failing checkin policies.  There's usually no reason to override checkin notes, it's easy enough to just specify them.



  • TF command line checkin