SVNOutput.Mod 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. MODULE SVNOutput; (** AUTHOR "rstoll"; *)
  2. IMPORT
  3. Commands;
  4. CONST
  5. ResOK* = 0;
  6. ResNOTVERSIONED* = -1;
  7. ResCLIENTOLD* = -2;
  8. ResFILENOTFOUND* = -3;
  9. ResALREADYVERSIONED* = -4;
  10. ResUPDATEFILEALREADYEXISTS* = -5;
  11. ResCHECKSUMMISMATCH* = -6;
  12. ResCOMMITNOMESSAGE* = -7;
  13. ResUNEXPECTEDSERVERRESPONSE* = -8;
  14. ResCOMMITOUTOFDATE* = -9;
  15. ResCOMMITUNSPECIFIED* = -10;
  16. ResNOTAUTHORIZED* = -11;
  17. ResADDDIRECTORYEXISTS* = -12;
  18. ResCHECKOUTALREADYDONE* = -13;
  19. UsageInfo* = 1;
  20. UsageCheckout* = 2;
  21. UsageCommit* = 3;
  22. UsageAdd* = 4;
  23. UsageDelete* = 5;
  24. UsageUpdate* = 6;
  25. DateFormat* = "yyyy-mm-ddThh:nn:ss.000000Z";
  26. TYPE
  27. Message* = OBJECT
  28. VAR
  29. context : Commands.Context;
  30. PROCEDURE &Init* ( c : Commands.Context );
  31. BEGIN
  32. context := c;
  33. END Init;
  34. PROCEDURE Print* ( num : WORD; CONST msg : ARRAY OF CHAR );
  35. BEGIN
  36. IF num = ResOK THEN
  37. RETURN;
  38. END;
  39. IF num < 0 THEN
  40. context.out.String ( "svn: " );
  41. END;
  42. CASE num OF
  43. ResNOTVERSIONED :
  44. context.out.String ( "'" );
  45. context.out.String ( msg );
  46. context.out.String ( "'" );
  47. context.out.String ( " is not a working copy" );
  48. | ResCLIENTOLD :
  49. context.out.String ( "This client is too old to work with working copy '" );
  50. context.out.String ( msg );
  51. context.out.String ( "'. You need to get a newer Subversion client, or downgrade this working copy." );
  52. | ResFILENOTFOUND :
  53. context.out.String ( "warning: '" );
  54. context.out.String ( msg );
  55. context.out.String ( "' not found" );
  56. | ResALREADYVERSIONED :
  57. context.out.String ( "warning: '" );
  58. context.out.String ( msg );
  59. context.out.String ( "' is already under version control" );
  60. | ResUPDATEFILEALREADYEXISTS :
  61. context.out.String ( "error: failed to add '" );
  62. context.out.String ( msg );
  63. context.out.String ( "': object of the same name already exists" );
  64. | ResCHECKSUMMISMATCH :
  65. context.out.String ( "Checksum mismatch for '" );
  66. context.out.String ( msg );
  67. context.out.String ( "'" );
  68. | ResCOMMITNOMESSAGE :
  69. context.out.String ( "error: no commit message specified" );
  70. | ResUNEXPECTEDSERVERRESPONSE :
  71. context.out.String ( "Server sent unexpected return value" );
  72. | ResCOMMITOUTOFDATE :
  73. context.out.String ( "Commit failed (details follow):" ); context.out.Ln;
  74. context.out.String ( "svn: File or directory '" );
  75. context.out.String ( msg );
  76. context.out.String ( "' is out of date; try updating" );
  77. | ResCOMMITUNSPECIFIED :
  78. context.out.String ( "Commit failed:" ); context.out.Ln;
  79. context.out.String ( "svn: Unknown Reason '" );
  80. context.out.String ( msg );
  81. context.out.String ( "'" );
  82. | ResNOTAUTHORIZED :
  83. context.out.String ( "not authorized. Please specify some credentials." );
  84. | ResADDDIRECTORYEXISTS :
  85. context.out.String ( "Failed to add directory '" );
  86. context.out.String ( msg );
  87. context.out.String ( "': an unversioned directory of the same name already exists" );
  88. | ResCHECKOUTALREADYDONE :
  89. context.out.String ( "Can't do a checkout into this directory: " );
  90. context.out.String ( msg );
  91. context.out.Ln;
  92. context.out.String ( "svn: Already checked out." );
  93. | UsageInfo :
  94. context.out.String ( "info: Displays information about a local item." ); context.out.Ln;
  95. context.out.String ( "usage: info [TARGET] ~" );
  96. | UsageUpdate :
  97. context.out.String ( "update: Bring changes from the repository into the working copy." ); context.out.Ln;
  98. context.out.String ( "usage: update [PATH] ~" ); context.out.Ln;
  99. | UsageCommit :
  100. context.out.String ( "commit: Send changes from your working copy to the repository." ); context.out.Ln;
  101. context.out.String ( "usage: commit [PATH] [OPTION] ~" ); context.out.Ln; context.out.Ln;
  102. context.out.String ( "options: \m ''Commit Message''" ); context.out.Ln;
  103. | UsageAdd :
  104. context.out.String ( "add: Put files and directories under version control, scheduling them for addition to repository. They will be added in the next commit." ); context.out.Ln;
  105. context.out.String ( "usage: add PATH... ~" ); context.out.Ln;
  106. | UsageDelete :
  107. context.out.String ( "delete: Remove files and directories from version control. Each item specified by a PATH is scheduled for deletion upon the next commit." ); context.out.Ln;
  108. context.out.String ( "usage: delete PATH... ~" ); context.out.Ln;
  109. | UsageCheckout :
  110. context.out.String ( "checkout: Check out a working copy from a repository." ); context.out.Ln;
  111. context.out.String ( "usage: checkout URL [PATH]" ); context.out.Ln;
  112. END;
  113. context.out.Ln; context.out.Update;
  114. END Print;
  115. END Message;
  116. END SVNOutput.