You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

vss.html 16 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542
  1. <html>
  2. <head>
  3. <title>Microsoft Visual SourceSafe(VSS) Tasks</title>
  4. </head>
  5. <body>
  6. <h1>Microsoft Visual SourceSafe Tasks User Manual</h1>
  7. <p>by</p>
  8. <ul>
  9. <li>Craig Cottingham</li>
  10. <li>Andrew Everitt</li>
  11. <li>Balazs Fejes 2</li>
  12. <li><a href="mailto:Glenn_Twiggs@bmc.com">Glenn_Twiggs@bmc.com</a></li>
  13. <li>Martin Poeschl (<a href="mailto:mpoeschl@marmot.at">mpoeschl@marmot.at</a>)</li>
  14. <li>Phillip Wells</li>
  15. <li>Jon Skeet (<a href="mailto:jon.skeet@peramon.com">jon.skeet@peramon.com</a>)</li>
  16. </ul>
  17. <p>2001/04/29</p>
  18. <hr>
  19. <h2>Contents</h2>
  20. <ul>
  21. <li><a href="#intro">Introduction</a></li>
  22. <li><a href="#tasks">The Tasks</a></li>
  23. </ul>
  24. <br>
  25. <h2><a name="intro">Introduction</a></h2>
  26. <p>These tasks provide an interface to the
  27. <a href="http://msdn.microsoft.com/ssafe/default.asp" target="_top">Microsoft Visual SourceSafe</a> SCM.
  28. The <code>org.apache.tools.ant.taskdefs.optional.vss</code> package consists of a simple framework to support
  29. vss functionality as well as some Ant tasks encapsulating frequently used vss commands.
  30. Although it is possible to use these commands on the desktop,
  31. they were primarily intended to be used by automated build systems.</p>
  32. <h2><a name="tasks">The Tasks</a></h2>
  33. <table border="0" cellspacing="0" cellpadding="3">
  34. <tr>
  35. <td><a href="#vssget">vssget</a></td>
  36. <td>Retrieves a copy of the specified VSS file(s).</td>
  37. </tr>
  38. <tr>
  39. <td><a href="#vsslabel">vsslabel</a></td>
  40. <td>Assigns a label to the specified version or current version of a file or project.</td>
  41. </tr>
  42. <tr>
  43. <td><a href="#vsshistory">vsshistory</a></td>
  44. <td>Shows the history of a file or project in VSS.</td>
  45. </tr>
  46. <tr>
  47. <td><a href="#vsscheckin">vsscheckin</a></td>
  48. <td>Updates VSS with changes made to a checked out file, and unlocks the VSS master copy.</td>
  49. </tr>
  50. <tr>
  51. <td><a href="#vsscheckout">vsscheckout</a></td>
  52. <td>Copies a file from the current project to the current folder, for the purpose of editing.</td>
  53. </tr>
  54. </table>
  55. <hr>
  56. <h2>Task Descriptions</h2>
  57. <!-- VSSGET -->
  58. <h2><a name="vssget">VssGet</a></h2>
  59. <h3>Description</h3>
  60. Task to perform GET commands to Microsoft Visual SourceSafe.
  61. <p>If you specify two or more attributes from version, date and
  62. label only one will be used in the order version, date, label.</p>
  63. <h3>Parameters</h3>
  64. <table border="1" cellpadding="2" cellspacing="0">
  65. <tr>
  66. <th>Attribute</th>
  67. <th>Values</th>
  68. <th>Required</th>
  69. </tr>
  70. <tr>
  71. <td>vsspath</td>
  72. <td>SourceSafe path which specifies the project/file(s) you wish to
  73. perform the action on. You should not specify the leading dollar-sign -
  74. it is prepended by Ant automatically.</td>
  75. <td>Yes</td>
  76. </tr>
  77. <tr>
  78. <td>login</td>
  79. <td>username[,password] - The username and password needed to get access
  80. to VSS. Note that you may need to specify both (if you have a password) -
  81. Ant/VSS will hang if you leave the password out and VSS does not accept
  82. login without a password. </td>
  83. <td>No</td>
  84. </tr>
  85. <tr>
  86. <td>localpath</td>
  87. <td>Override the working directory and get to the specified path</td>
  88. <td>No</td>
  89. </tr>
  90. <tr>
  91. <td>ssdir</td>
  92. <td>directory where <code>ss.exe</code> resides. By default the
  93. task expects it to be in the PATH.</td>
  94. <td>No</td>
  95. </tr>
  96. <tr>
  97. <td>serverPath</td>
  98. <td>directory where <code>srssafe.ini</code> resides.</td>
  99. <td>No</td>
  100. </tr>
  101. <tr>
  102. <td>writable</td>
  103. <td>true or false</td>
  104. <td>No</td>
  105. </tr>
  106. <tr>
  107. <td>recursive</td>
  108. <td>true or false</td>
  109. <td>No</td>
  110. </tr>
  111. <tr>
  112. <td>version</td>
  113. <td>a version number to get</td>
  114. <td rowspan="3">No, only one of these allowed</td>
  115. </tr>
  116. <tr>
  117. <td>date</td>
  118. <td>a date stamp to get at</td>
  119. </tr>
  120. <tr>
  121. <td>label</td>
  122. <td>a label to get for</td>
  123. </tr>
  124. <tr>
  125. <td>quiet</td>
  126. <td>suppress output (off by default)</td>
  127. <td>No</td>
  128. </tr>
  129. <tr>
  130. <td>autoresponse</td>
  131. <td>What to respond with (sets the -I option). By default, -I- is
  132. used; values of Y or N will be appended to this.</td>
  133. <td>No</td>
  134. </tr>
  135. </table>
  136. <p>Note that only one of version, date or label should be specified</p>
  137. <h3>Examples</h3>
  138. <blockquote>
  139. <pre>
  140. &lt;vssget localPath=&quot;C:\mysrc\myproject&quot;
  141. recursive=&quot;true&quot;
  142. label=&quot;Release1&quot;
  143. login=&quot;me,mypassword&quot;
  144. vsspath=&quot;/source/aProject&quot;
  145. writable=&quot;true&quot;/&gt;
  146. </pre>
  147. </blockquote>
  148. <p>Does a get on the VSS-Project <i>$/source/myproject</i> using the username
  149. <i>me</i> and the password <i>mypassword</i>. It will recursively get the files
  150. which are labeled <i>Release1</i> and write them to the local directory
  151. <i>C:\mysrc\myproject</i>. The local files will be writable.</p>
  152. <hr>
  153. <!-- VSSLABEL -->
  154. <h2><a name="vsslabel">VssLabel</a></h2>
  155. <h3>Description</h3>
  156. Task to perform LABEL commands to Microsoft Visual SourceSafe.
  157. <p>Assigns a label to the specified version or current version of a file or
  158. project.</p>
  159. <h3>Parameters</h3>
  160. <table border="1" cellpadding="2" cellspacing="0">
  161. <tr>
  162. <th>Attribute</th>
  163. <th>Values</th>
  164. <th>Required</th>
  165. </tr>
  166. <tr>
  167. <td>vsspath</td>
  168. <td>SourceSafe path which specifies the project/file(s) you wish to
  169. perform the action on. You should not specify the leading dollar-sign -
  170. it is prepended by Ant automatically.</td>
  171. <td>Yes</td>
  172. </tr>
  173. <tr>
  174. <td>login</td>
  175. <td>username[,password] - The username and password needed to get access
  176. to VSS. Note that you may need to specify both (if you have a password) -
  177. Ant/VSS will hang if you leave the password out and VSS does not accept
  178. login without a password. </td>
  179. <td>No</td>
  180. </tr>
  181. <tr>
  182. <td>ssdir</td>
  183. <td>directory where <code>ss.exe</code> resides. By default the
  184. task expects it to be in the PATH.</td>
  185. <td>No</td>
  186. </tr>
  187. <tr>
  188. <td>serverPath</td>
  189. <td>directory where <code>srssafe.ini</code> resides.</td>
  190. <td>No</td>
  191. </tr>
  192. <tr>
  193. <td>label</td>
  194. <td>A label to apply to the hierarchy</td>
  195. <td>Yes</td>
  196. </tr>
  197. <tr>
  198. <td>version</td>
  199. <td>An existing file or project version to label. By default the current
  200. version is labelled.</td>
  201. <td>No</td>
  202. </tr>
  203. <tr>
  204. <td>comment</td>
  205. <td>The comment to use for this label. Empty or '-' for no comment.</td>
  206. <td>No</td>
  207. </tr>
  208. <tr>
  209. <td>autoresponse</td>
  210. <td>What to respond with (sets the -I option). By default, -I- is
  211. used; values of Y or N will be appended to this.</td>
  212. <td>No</td>
  213. </tr>
  214. </table>
  215. <h3>Examples</h3>
  216. <blockquote>
  217. <pre>
  218. &lt;vsslabel vsspath=&quot;/source/aProject&quot;
  219. login=&quot;me,mypassword&quot;
  220. label=&quot;Release1&quot;/&gt;
  221. </pre>
  222. </blockquote>
  223. <p>Labels the current version of the VSS project <i>$/source/aProject</i> with
  224. the label <i>Release1</i> using the username <i>me</i> and the password
  225. <i>mypassword</i>.
  226. </p>
  227. <blockquote>
  228. <pre>
  229. &lt;vsslabel vsspath=&quot;/source/aProject/myfile.txt&quot;
  230. version=&quot;4&quot;
  231. label=&quot;1.03.004&quot;/&gt;
  232. </pre>
  233. </blockquote>
  234. <p>Labels version 4 of the VSS file <i>$/source/aProject/myfile.txt</i> with the
  235. label <i>1.03.004</i>. If this version already has a label, the operation (and
  236. the build) will fail.
  237. </p>
  238. <hr>
  239. <!-- VSSHISTORY -->
  240. <h2><a name="vsshistory">VssHistory</a></h2>
  241. <h3>Description</h3>
  242. Task to perform HISTORY commands to Microsoft Visual SourceSafe.
  243. <h3>Parameters</h3>
  244. <table border="1" cellpadding="2" cellspacing="0">
  245. <tr>
  246. <th>Attribute</th>
  247. <th>Values</th>
  248. <th>Required</th>
  249. </tr>
  250. <tr>
  251. <td>vsspath</td>
  252. <td>SourceSafe path which specifies the project/file(s) you wish to
  253. perform the action on. You should not specify the leading dollar-sign -
  254. it is prepended by Ant automatically.</td>
  255. <td>Yes</td>
  256. </tr>
  257. <tr>
  258. <td>login</td>
  259. <td>username[,password] - The username and password needed to get access
  260. to VSS. Note that you may need to specify both (if you have a password) -
  261. Ant/VSS will hang if you leave the password out and VSS does not accept
  262. login without a password. </td>
  263. <td>No</td>
  264. </tr>
  265. <tr>
  266. <td>ssdir</td>
  267. <td>directory where <code>ss.exe</code> resides. By default the
  268. task expects it to be in the PATH.</td>
  269. <td>No</td>
  270. </tr>
  271. <tr>
  272. <td>serverPath</td>
  273. <td>directory where <code>srssafe.ini</code> resides.</td>
  274. <td>No</td>
  275. </tr>
  276. <tr>
  277. <td>fromDate</td>
  278. <td>Start date for comparison</td>
  279. <td>See below</td>
  280. </tr>
  281. <tr>
  282. <td>toDate</td>
  283. <td>Start date for comparison</td>
  284. <td>See below</td>
  285. </tr>
  286. <tr>
  287. <td>dateFormat</td>
  288. <td>Format of dates in fromDate and toDate. Used when calculating dates with
  289. the numdays attribute. This string uses the formatting rules of SimpleDateFormat.
  290. Defaults to DateFormat.SHORT.</td>
  291. <td>No</td>
  292. </tr>
  293. <tr>
  294. <td>fromLabel</td>
  295. <td>Start label for comparison</td>
  296. <td>No</td>
  297. </tr>
  298. <tr>
  299. <td>toLabel</td>
  300. <td>Start label for comparison</td>
  301. <td>No</td>
  302. </tr>
  303. <tr>
  304. <td>numdays</td>
  305. <td>The number of days for comparison.</td>
  306. <td>See below</td>
  307. </tr>
  308. <tr>
  309. <td>output</td>
  310. <td>File to write the diff.</td>
  311. <td>No</td>
  312. </tr>
  313. <tr>
  314. <td>recursive</td>
  315. <td>true or false</td>
  316. <td>No</td>
  317. </tr>
  318. <tr>
  319. <td>style</td>
  320. <td>brief, codediff, default or nofile. The default is default.</td>
  321. <td>No</td>
  322. </tr>
  323. </table>
  324. <h4>Specifying the time-frame</h4>
  325. <p>There are different ways to specify what time-frame you wish to evaluate:</p>
  326. <ul>
  327. <li>Changes between two dates: Specify both <code>fromDate</code> and <code>toDate</code> </li>
  328. <li>Changes before a date: Specify <code>toDate</code></li>
  329. <li>Changes after a date: Specify <code>fromDate</code></li>
  330. <li>Changes X Days before a date: Specify <code>toDate</code> and (negative!) <code>numDays</code></li>
  331. <li>Changes X Days after a date: Specify <code>fromDate</code> and <code>numDays</code></li>
  332. </ul>
  333. <h3>Examples</h3>
  334. <blockquote>
  335. <pre>
  336. &lt;vsshistory vsspath=&quot;/myProject&quot; recursive=&quot;true&quot;
  337. fromLabel=&quot;Release1&quot;
  338. toLabel=&quot;Release2&quot;/&gt;
  339. </pre>
  340. </blockquote>
  341. <p>Shows all changes between &quot;Release1&quot; and &quot;Release2&quot;.</p>
  342. <blockquote>
  343. <pre>
  344. &lt;vsshistory vsspath=&quot;/myProject&quot; recursive=&quot;true&quot;
  345. fromDate=&quot;01.01.2001&quot;
  346. toDate=&quot;31.03.2001&quot;/&gt;
  347. </pre>
  348. </blockquote>
  349. <p>Shows all changes between January 1st 2001 and March 31st 2001 (in Germany, date must be specified according to your locale).</p>
  350. <blockquote>
  351. <pre>
  352. &lt;tstamp&gt;
  353. &lt;format property=&quot;to.tstamp&quot; pattern=&quot;M-d-yy;h:mma&quot; /&gt;
  354. &lt;/tstamp&gt;
  355. &lt;vsshistory vsspath=&quot;/myProject&quot; recursive=&quot;true&quot;
  356. numDays=&quot;-14&quot;
  357. dateFormat=&quot;M-d-yy;h:mma&quot;
  358. toDate=&quot;${to.tstamp}&quot;/&gt;
  359. </pre>
  360. </blockquote>
  361. <p>Shows all changes in the 14 days before today.</p>
  362. <hr>
  363. <!-- VSSCHECKIN -->
  364. <h2><a name="vsscheckin">VssCheckin</a></h2>
  365. <h3>Description</h3>
  366. Task to perform CHECKIN commands to Microsoft Visual SourceSafe.
  367. <h3>Parameters</h3>
  368. <table border="1" cellpadding="2" cellspacing="0">
  369. <tr>
  370. <th>Attribute</th>
  371. <th>Values</th>
  372. <th>Required</th>
  373. </tr>
  374. <tr>
  375. <td>vsspath</td>
  376. <td>SourceSafe path which specifies the project/file(s) you wish to
  377. perform the action on. You should not specify the leading dollar-sign -
  378. it is prepended by Ant automatically.</td>
  379. <td>Yes</td>
  380. </tr>
  381. <tr>
  382. <td>login</td>
  383. <td>username[,password] - The username and password needed to get access
  384. to VSS. Note that you may need to specify both (if you have a password) -
  385. Ant/VSS will hang if you leave the password out and VSS does not accept
  386. login without a password. </td>
  387. <td>No</td>
  388. </tr>
  389. <tr>
  390. <td>localpath</td>
  391. <td>Override the working directory and get to the specified path</td>
  392. <td>No</td>
  393. </tr>
  394. <tr>
  395. <td>ssdir</td>
  396. <td>directory where <code>ss.exe</code> resides. By default the
  397. task expects it to be in the PATH.</td>
  398. <td>No</td>
  399. </tr>
  400. <tr>
  401. <td>serverPath</td>
  402. <td>directory where <code>srssafe.ini</code> resides.</td>
  403. <td>No</td>
  404. </tr>
  405. <tr>
  406. <td>writable</td>
  407. <td>true or false</td>
  408. <td>No</td>
  409. </tr>
  410. <tr>
  411. <td>recursive</td>
  412. <td>true or false</td>
  413. <td>No</td>
  414. </tr>
  415. <tr>
  416. <td>comment</td>
  417. <td>Comment to use for the files that where checked in.</td>
  418. <td>No</td>
  419. </tr>
  420. <tr>
  421. <td>autoresponse</td>
  422. <td>'Y', 'N' or empty. Specify how to reply to questions from VSS.</td>
  423. <td>No</td>
  424. </tr>
  425. </table>
  426. <h3>Examples</h3>
  427. <blockquote>
  428. <pre>
  429. &lt;vsscheckin vsspath=&quot;/test/test*&quot;
  430. localpath=&quot;D:\build\&quot;
  431. comment=&quot;Modified by automatic build&quot;/&gt;
  432. </pre>
  433. </blockquote>
  434. <p>Checks in the file(s) named <i>test*</i> in the project <i>test</i> using
  435. the local directory <i>D:\build</i>.</p>
  436. <hr>
  437. <!-- VSSCHECKOUT -->
  438. <h2><a name="vsscheckout">VssCheckout</a></h2>
  439. <h3>Description</h3>
  440. Task to perform CHECKOUT commands to Microsoft Visual SourceSafe.
  441. <p>If you specify two or more attributes from version, date and
  442. label only one will be used in the order version, date, label.</p>
  443. <h3>Parameters</h3>
  444. <table border="1" cellpadding="2" cellspacing="0">
  445. <tr>
  446. <th>Attribute</th>
  447. <th>Values</th>
  448. <th>Required</th>
  449. </tr>
  450. <tr>
  451. <td>vsspath</td>
  452. <td>SourceSafe path which specifies the project/file(s) you wish to
  453. perform the action on. You should not specify the leading dollar-sign -
  454. it is prepended by Ant automatically.</td>
  455. <td>Yes</td>
  456. </tr>
  457. <tr>
  458. <td>login</td>
  459. <td>username[,password] - The username and password needed to get access
  460. to VSS. Note that you may need to specify both (if you have a password) -
  461. Ant/VSS will hang if you leave the password out and VSS does not accept
  462. login without a password. </td>
  463. <td>No</td>
  464. </tr>
  465. <tr>
  466. <td>localpath</td>
  467. <td>Override the working directory and get to the specified path</td>
  468. <td>No</td>
  469. </tr>
  470. <tr>
  471. <td>ssdir</td>
  472. <td>directory where <code>ss.exe</code> resides. By default the
  473. task expects it to be in the PATH.</td>
  474. <td>No</td>
  475. </tr>
  476. <tr>
  477. <td>serverPath</td>
  478. <td>directory where <code>srssafe.ini</code> resides.</td>
  479. <td>No</td>
  480. </tr>
  481. <tr>
  482. <td>writable</td>
  483. <td>true or false</td>
  484. <td>No</td>
  485. </tr>
  486. <tr>
  487. <td>recursive</td>
  488. <td>true or false</td>
  489. <td>No</td>
  490. </tr>
  491. <tr>
  492. <td>version</td>
  493. <td>a version number to get</td>
  494. <td rowspan="3">No, only one of these allowed</td>
  495. </tr>
  496. <tr>
  497. <td>date</td>
  498. <td>a date stamp to get at</td>
  499. </tr>
  500. <tr>
  501. <td>label</td>
  502. <td>a label to get for</td>
  503. </tr>
  504. </table>
  505. <h3>Examples</h3>
  506. <blockquote>
  507. <pre>
  508. &lt;vsscheckout vsspath=&quot;/test&quot;
  509. localpath=&quot;D:\build&quot;
  510. recursive=&quot;true&quot;
  511. login=&quot;me,mypass&quot;/&gt;
  512. </pre>
  513. </blockquote>
  514. <p>Does a recursive checkout of the project test to the directory D:\build.
  515. </p>
  516. <hr>
  517. <p align="center">Copyright &copy; 2001 Apache Software Foundation. All rights
  518. Reserved.</p>
  519. </body>
  520. </html>