Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

72 lines
1.6 KiB

  1. # __________________________________________________________________________________
  2. #
  3. # Purpose:
  4. # PERL Script to create a label based on current client's ssync state
  5. #
  6. # Parameters:
  7. # See Usage below
  8. #
  9. # Output:
  10. # Perforce output or the appropriate error message or usage statement
  11. #
  12. # __________________________________________________________________________________
  13. #
  14. # Load common SLM wrapper subroutine module
  15. #
  16. use SlmSubs;
  17. #
  18. # Parse command line arguments
  19. #
  20. SlmSubs::ParseArgs(@ARGV);
  21. #
  22. # Call usage and exit if ParseArgs has set the Usage or InvalidFlag flags
  23. #
  24. if ($Usage or $InvalidFlag)
  25. {
  26. print $ErrorMessage;
  27. &Usage;
  28. exit 1;
  29. }
  30. #
  31. # Need to have a label name
  32. #
  33. if (!@OriginalFileList)
  34. {
  35. print "\n";
  36. print "Error: No label name specified\n";
  37. print "\n";
  38. &Usage;
  39. exit 1;
  40. }
  41. #
  42. # Create a label with the name from @OriginalFileList. Take all the defaults.
  43. # Base it on current ssync state.
  44. #
  45. system "$SourceControlClient label -o \"@OriginalFileList\" > $ENV{tmp}\\TmpLabelFile";
  46. system "$SourceControlClient label -i < $ENV{tmp}\\TmpLabelFile >nul";
  47. system "$SourceControlClient labelsync -l \"@OriginalFileList\" > nul";
  48. sub Usage
  49. # __________________________________________________________________________________
  50. #
  51. # Prints out a usage statement for this script.
  52. #
  53. # Parameters:
  54. # None
  55. #
  56. # Output:
  57. # The usage statement
  58. #
  59. # __________________________________________________________________________________
  60. {
  61. print q/label - creates a label based on current ssync state
  62. Usage: label LabelName
  63. Arguments:
  64. -h prints out this message.
  65. /;
  66. }