Leaked source code of windows server 2003
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.

967 lines
30 KiB

  1. # __________________________________________________________________________________
  2. #
  3. # SDX.PL
  4. #
  5. # Purpose:
  6. # PERL Module to handle common tasks for SDX
  7. #
  8. # Parameters:
  9. # Specific to subroutine
  10. #
  11. # Output:
  12. # Specific to subroutine
  13. #
  14. # __________________________________________________________________________________
  15. use SDX;
  16. #
  17. # initialize
  18. #
  19. SDX::Init(@ARGV);
  20. #
  21. # maybe do usage
  22. #
  23. if ($Usage)
  24. {
  25. &Usage;
  26. exit 1;
  27. }
  28. #
  29. # dispatch based on the user's cmd
  30. #
  31. if (exists($main::SDCmds{$main::SDCmd}))
  32. {
  33. #
  34. # call the function
  35. #
  36. $main::SDCmds{$main::SDCmd}{fn}->($main::SDCmd, $main::UserArgs);
  37. if ($main::DepotErrors)
  38. {
  39. exit 1;
  40. }
  41. else
  42. {
  43. exit 0;
  44. }
  45. }
  46. else
  47. {
  48. printf "\nUnknown command '%s'.\n", $main::SDCmd;
  49. &Usage;
  50. exit 1;
  51. }
  52. # __________________________________________________________________________________
  53. #
  54. # Usage
  55. #
  56. # Parameters:
  57. #
  58. # Output:
  59. # __________________________________________________________________________________
  60. sub Usage
  61. {
  62. print "\n";
  63. sleep(1);
  64. print "\nSDX 1.03 USAGE\n--------------\n";
  65. print "SDX command [command-args] [SD-args] [filespec] [-? -g]\n";
  66. print "\nUse SDX to work with Source Depot commands across one or more depots from\n";
  67. print "a single client enlistment.\n";
  68. print "\nYou must set %SDXROOT% to the full path of your enlistment root, ie D:\\NT,\n";
  69. print "C:\\SRC, etc. before using SDX.\n";
  70. print "\n\nGENERAL OPTIONS\n---------------\n";
  71. print "These command-line arguments are available:\n";
  72. print "\n [command-args]\targuments specific to the SDX command\n";
  73. print " [SD-args]\t\targuments for the underlying SoureDepot command\n";
  74. print " [filespec]\t\tSD wildcards to restrict the scope of command\n";
  75. print " -?\t\t\tusage\n";
  76. print " -g [file]\t\tlog output to file, where [file] is a fully\n";
  77. print "\t\t\tqualified path\n";
  78. $main::GetStarted and do
  79. {
  80. print "\n\nGETTING STARTED\n---------------\n";
  81. print "Set SDXROOT=D:\\NT (or whatever your enlistment root directory is), then:\n\n";
  82. print "To enlist in projects, run 'sdx enlist'.\n\n";
  83. print "To defect from one or more projects, run 'sdx defect'.\n\n";
  84. print "To repair your enlistment, run 'sdx repair'.\n\n";
  85. print "To see other SDX commands, run 'sdx commands'.\n";
  86. print "\n\nEmail SDX to report bugs in this script.\n";
  87. print "\nSource Depot documentation is available at $main::SDWeb.\n";
  88. };
  89. $main::SDCmd eq "admin" and do
  90. {
  91. print "\n\nSDX ADMIN\n------------\n";
  92. print "Use\n";
  93. print "\n sdx admin status [-b -c -d -h] [id]\n";
  94. print "\nto see status for connections to the depots.\n";
  95. &MoreInfo($main::SDCmd);
  96. return;
  97. };
  98. $main::SDCmd eq "backup" and do
  99. {
  100. print "\n\nSDX BACKUP\n------------\n";
  101. print "Use\n";
  102. print "\n sdx backup [path]\n";
  103. print "\nto \n";
  104. return;
  105. };
  106. $main::SDCmd eq "branch" and do
  107. {
  108. print "\n\nSDX BRANCH\n-----------\n";
  109. print "Use\n";
  110. print "\n sdx branch -o branch\n";
  111. print "\nto dump the branch spec for the named branch.\n";
  112. &MoreInfo($main::SDCmd);
  113. return;
  114. };
  115. $main::SDCmd eq "branches" and do
  116. {
  117. print "\n\nSDX BRANCHES\n------------\n";
  118. print "Use\n";
  119. print "\n sdx branches\n";
  120. print "\nto list existing branches in each depot.\n";
  121. &MoreInfo($main::SDCmd);
  122. return;
  123. };
  124. $main::SDCmd eq "change" and do
  125. {
  126. print "\n\nSDX CHANGE\n-----------\n";
  127. print "Use\n";
  128. print "\n sdx change -o\n";
  129. print "\nto dump the default changelist in each depot.\n";
  130. &MoreInfo($main::SDCmd);
  131. return;
  132. };
  133. $main::SDCmd eq "changes" and do
  134. {
  135. print "\n\nSDX CHANGES\n-----------\n";
  136. print "Use\n";
  137. print "\n sdx changes\n";
  138. print "\nto show pending and submitted changelists in each project.\n";
  139. &MoreInfo($main::SDCmd);
  140. return;
  141. };
  142. $main::SDCmd eq "client" and do
  143. {
  144. print "\n\nSDX CLIENT\n----------\n";
  145. print "Use\n";
  146. print "\n sdx client -d name\n";
  147. print " sdx client -o [name]\n";
  148. print "\nto display a client specification or delete a client.\n";
  149. print "\nThe arguments are:\n";
  150. print "\n -d name\tDeletes the named client.\n";
  151. print "\n -o [name]\twrites client spec for current or named client to stdout.\n";
  152. &MoreInfo($main::SDCmd);
  153. return;
  154. };
  155. $main::SDCmd eq "clients" and do
  156. {
  157. print "\n\nSDX CLIENTS\n-----------\n";
  158. print "Use\n";
  159. print "\n sdx clients\n";
  160. print "\nto display clients in each project.\n";
  161. print "\nThe arguments are:\n";
  162. print "\n -a\tprint summary count only.\n";
  163. print "\n -t\tprint as table sorted by last access time.\n";
  164. &MoreInfo($main::SDCmd);
  165. return;
  166. };
  167. $main::SDCmd eq "commands" and do
  168. {
  169. print "\n\nCOMMANDS\n--------\n";
  170. print "These commands help you work with SDX:\n\n";
  171. print " sdx commands\tlist all cross-depot commands\n";
  172. print " sdx usage\t\texplain SDX commands\n";
  173. print "\nThese commands change the state of your enlistment:\n\n";
  174. print " sdx defect\t\tdefect from one or more projects\n";
  175. print " sdx enlist\t\tenlist projects from multiple depots\n";
  176. print " sdx integrate\tintegrate changes between branched projects\n";
  177. ### print " sdx privatebranch\tcreate private dev branch in each enlisted project\n";
  178. print " sdx label\t\tcreate a label in each depot\n";
  179. print " sdx labelsync\t\tsync a label\n";
  180. print " sdx repair\t\trepair SD.MAP/SD.INI's and refresh files\n";
  181. print " sdx resolve\t\tresolve merged files in each depot\n";
  182. print " sdx revert\t\trevert open files to their previous revision\n";
  183. print " sdx submit\t\tsubmit changelists in each depot\n";
  184. print " sdx sync\t\tsync your enlistment to new files in each depot\n";
  185. print "\nThese commands report on the state of your enlistment:\n\n";
  186. print " sdx branch\tdisplay a branch spec\n";
  187. print " sdx branches\tlist branches\n";
  188. print " sdx client\t\tdisplay client specification to stdout\n";
  189. print " sdx clients\t\tlist all clients\n";
  190. print " sdx change\t\tdisplay the contents of a changelist\n";
  191. print " sdx changes\t\tlist submitted changelists\n";
  192. print " sdx counters\tlist counters\n";
  193. print " sdx files\t\tshow file summary info for every file\n";
  194. print " sdx have\t\tshow file revisions you have\n";
  195. print " sdx info\t\tshow depot information\n";
  196. print " sdx integrated\tdisplay branch and merge information\n";
  197. print " sdx labels\t\tlist all labels\n";
  198. print " sdx opened\t\tshow which files you have opened\n";
  199. print " sdx pending\t\tshow pending changes\n";
  200. print " sdx resolved\tshow files merged but not submitted\n";
  201. print " sdx status\t\tshow files opened and out of sync\n";
  202. print " sdx user\t\tshow information about a user\n";
  203. print " sdx users\t\tlist all users\n";
  204. print " sdx where\t\tshow how file names map through the client view\n";
  205. print "\nAdministrative commands:\n\n";
  206. print " sdx labbranch\tcreate virtual lab branch in each enlisted project\n";
  207. print " sdx protect\t\tset permissions on files and directories\n";
  208. print "\nFor information on a particular SDX command, run 'sdx [command] /?'.\n";
  209. print "\nFor information on Source Depot commands, run 'sd help commands'.\n";
  210. ### print " sdx client\t\tedit your client spec and view for each depot\n";
  211. ### print " sdx delete\t\tdelete [filespec] in every project\n";
  212. ### print " sdx edit\t\topen [filespec] for edit in every project\n";
  213. ### print " sdx refresh\t\tdiff and possibly resync files in your client view\n";
  214. ### print " sdx reopen\t\treopen [filespec] in every project\n";
  215. ### print " sdx user\t\tedit user spec for each depot\n";
  216. ### print " sdx depots\t\tlist all depot names\n";
  217. ### print " sdx filelog\t\tlist history of files\n";
  218. ### print " sdx jobs\t\tdisplay job lists\n";
  219. ### print " sdx print\t\tprint contents of [filespec] to stdout\n";
  220. return;
  221. };
  222. $main::SDCmd eq "counters" and do
  223. {
  224. print "\n\nSDX COUNTERS\n------------\n";
  225. print "Use\n";
  226. print "\n sdx counters\n";
  227. print "\nto \n";
  228. &MoreInfo($main::SDCmd);
  229. return;
  230. };
  231. $main::SDCmd eq "defect" and do
  232. {
  233. print "\n\nSDX DEFECT\n----------\n";
  234. print "Use\n";
  235. print "\n sdx defect [projects | -a] [-f -q]\n";
  236. print "\nto remove one or more projects from your local enlistment. Defecting syncs\n";
  237. print "the named project(s) to remove sources and deletes the project from your\n";
  238. print "client view.\n";
  239. print "\nThe arguments are:\n";
  240. print "\n projects\tOne or more source projects.";
  241. if ($main::CodeBase)
  242. {
  243. print " Projects for $main::CodeBase are:\n\n";
  244. foreach $project (@main::AllProjects)
  245. {
  246. print "\t\t @$project[0]\n";
  247. }
  248. }
  249. else
  250. {
  251. print "\n";
  252. }
  253. print "\n -a\t\tAll projects. Overrides those listed singly or by group.\n";
  254. print "\n -f\t\tRemoves all files and directories in projects when defecting,\n";
  255. print "\t\tnot just those under source control.\n";
  256. print "\n -q\t\tQuiet; don't pause to let user verify settings.\n";
  257. return;
  258. };
  259. $main::SDCmd eq "deletefile" and do
  260. {
  261. print "\n\nSDX DELETEFILE\n--------------\n";
  262. print "Use\n";
  263. print "\n sdx deletefile filespec\n";
  264. print "\nto delete the specified files in each project.\n";
  265. &MoreInfo("delete");
  266. return;
  267. };
  268. $main::SDCmd eq "editfile" and do
  269. {
  270. print "\n\nSDX EDITFILE\n------------\n";
  271. print "Use\n";
  272. print "\n sdx editfile filespec\n";
  273. print "\nto edit the specified files in each project.\n";
  274. &MoreInfo("edit");
  275. return;
  276. };
  277. $main::SDCmd eq "enlist" and do
  278. {
  279. print "\n\nSDX ENLIST\n----------\n";
  280. print "Use\n";
  281. print "\n sdx enlist codebase branch [projects | -a] [-c -m -q -s -x]\n";
  282. ### print " sdx enlist codebase branch \@client [-q -s]\n";
  283. print " sdx enlist -p file [-c -m -q -s -x]\n";
  284. print " sdx enlist [projects | -a] [-c -m -q -s -x]\n";
  285. print "\nto create or add to an enlistment on your local machine that contains\n";
  286. print "projects from one or more source servers.\n";
  287. print "\nYou must be logged in with domain credentials and not on your local machine.\n";
  288. print "\nThe arguments are:\n";
  289. print "\n codebase\tThe set of projects you're enlisting in, generally the name\n";
  290. print "\t\tof the product you work on. Codebases are described in\n";
  291. print "\t\tPROJECTS.<codebase> files in the SDX directory or share.\n";
  292. print "\n\t\tThose you can enlist in are:\n\n";
  293. SDX::GetCodeBases();
  294. print "\n\t\tFor new enlistments the codebase is a required argument.\n";
  295. print "\n branch\tThe master or group branch you want to work in. Required for\n";
  296. print "\t\tnew enlistments.\n";
  297. if ($main::CodeBase)
  298. {
  299. #
  300. # make some calls so we can list projects etc for the user
  301. #
  302. !SDX::VerifyCBMap($main::CodeBase) and die("\n\nCan't find codebase map $main::CodeBaseMap.\n");
  303. SDX::ReadCodeBaseMap();
  304. SDX::MakePGDLists();
  305. $main::CodeBase =~ tr/a-z/A-Z/;
  306. print "\n\t\tBranches for $main::CodeBase are:\n";
  307. print "\n\t\t $main::MasterBranch\n\n";
  308. foreach $branch (@main::GroupBranches)
  309. {
  310. #$branch =~ tr/a-z/A-Z/;
  311. printf "\t\t %s\n", $branch;
  312. }
  313. }
  314. print "\n projects\tOne or more source projects.";
  315. if ($main::CodeBase)
  316. {
  317. print " Projects for $main::CodeBase are:\n\n";
  318. foreach $project (@main::AllProjects)
  319. {
  320. print "\t\t @$project[0]\n";
  321. ### printf "\t\t %-20s\t%s\n", @$project[0], "(@$project[1])";
  322. }
  323. }
  324. else
  325. {
  326. print "\n";
  327. }
  328. print "\n -a\t\tAll projects. Overrides those listed singly or by group.\n";
  329. print "\n -c\t\tClean enlistment. Gives you the default view for each depot\n";
  330. print "\t\tand overwrites any view changes you've made.\n";
  331. print "\n -m\t\tMinimal tools. Gives you only the tools necessary for running\n";
  332. print "\t\tSD/SDX.\n";
  333. print "\n -p file\tRead codebase, branch and projects from file. For new\n";
  334. print "\t\tenlistments only.\n";
  335. print "\n -q\t\tQuiet; don't pause to let user verify settings.\n";
  336. print "\n -s\t\tSync files after enlisting. Off by default.\n";
  337. print "\n -x\t\tInclude all x86/ia64/amd64 directories in all projects\n";
  338. print "\t\tin your client view. Depending on the codebase, platforms\n";
  339. print "\t\tother than $ENV{PROCESSOR_ARCHITECTURE} may be excluded in large projects to save\n";
  340. print "\t\tdisk space.\n";
  341. ### print "\n \@client\tEnlist identically to another client. Gives you a view of the\n";
  342. ### print "\t\tsame branches and projects as the other client. For new\n";
  343. ### print "\t\tenlistments only.\n";
  344. !$main::CodeBase and do
  345. {
  346. print "\nTo see which branches, groups and projects are available for a particular\n";
  347. print "codebase, run 'sdx enlist <codebase>'.\n";
  348. };
  349. print "\nWhen enlisting, the SD user name is %USERNAME% unless %SDUSER% is already\n";
  350. print "set. The SD client name is %COMPUTERNAME% unless the client already exists;\n";
  351. print "then %COMPUTERNAME%-N is used for uniqueness.\n";
  352. return;
  353. };
  354. $main::SDCmd eq "files" and do
  355. {
  356. print "\n\nSDX FILES\n---------\n";
  357. print "Use\n";
  358. print "\n sdx files\n";
  359. print "\nto list files in each depot.\n";
  360. print "\nThe arguments are:\n";
  361. print "\n -a\tprint summary count only.\n";
  362. &MoreInfo($main::SDCmd);
  363. return;
  364. };
  365. $main::SDCmd eq "flush" and do
  366. {
  367. print "\n\nSDX FLUSH\n----------\n";
  368. print "Use\n";
  369. print "\n sdx flush [-f -h -n -q] [file[revRange] ...]\n";
  370. print "\nto mark files as synchronized in each project without actually moving\n";
  371. print "files to your client enlistment.\n";
  372. print "\nThe arguments are:\n";
  373. print "\n file[revRange]\tFilespec and revision range.\n";
  374. print "\n -f\t\t\tForces resynchronization of files and clobbers\n";
  375. print "\t\t\twriteable files.\n";
  376. print "\n -h\t\t\tShows changelists flushed instead of files.\n";
  377. print "\n -n\t\t\tShows what would be flushed without doing it.\n";
  378. print "\n -q\t\t\tQuiet; suppresses screen output. Does not affect\n";
  379. print "\t\t\toutput logged to file.\n";
  380. &MoreInfo($main::SDCmd);
  381. return;
  382. };
  383. $main::SDCmd eq "have" and do
  384. {
  385. print "\n\nSDX HAVE\n--------\n";
  386. print "Use\n";
  387. print "\n sdx have\n";
  388. print "\nto \n";
  389. &MoreInfo($main::SDCmd);
  390. return;
  391. };
  392. $main::SDCmd eq "info" and do
  393. {
  394. print "\n\nSDX INFO\n--------\n";
  395. print "Use\n";
  396. print "\n sdx info\n";
  397. print "\nto \n";
  398. &MoreInfo($main::SDCmd);
  399. return;
  400. };
  401. $main::SDCmd eq "integrate" and do
  402. {
  403. print "\n\nSDX INTEGRATE\n-------------\n";
  404. print "Use\n";
  405. print " sdx integrate [-f -n -r -v] -b branch [toFile[revRange] ...]\n";
  406. print " sdx integrate [-f -n -r -v] -b branch -s fromFile[revRange] [toFile ...]\n";
  407. print "\nto integrate file changes in each project between group or private branches.\n";
  408. print "\nFor more information and a description of the arguments, run 'sd help\n";
  409. print "integrate' or see the Source Depot User Guide at $main::SDWeb.\n";
  410. &MoreInfo($main::SDCmd);
  411. return;
  412. };
  413. $main::SDCmd eq "integrated" and do
  414. {
  415. print "\n\nSDX INTEGRATED\n--------------\n";
  416. print "Use\n";
  417. print "\n sdx integrated file ...\n";
  418. print "\nto show integrations that have been submitted in each project\n";
  419. print "for file.\n";
  420. &MoreInfo($main::SDCmd);
  421. return;
  422. };
  423. $main::SDCmd eq "labbranch" and do
  424. {
  425. print "\n\nSDX LABBRANCH\n-------------\n";
  426. print "Use\n";
  427. print "\n sdx labbranch name\n";
  428. print " sdx labbranch -d [-f] name\n";
  429. print " sdx labbranch -o name\n";
  430. print "\nto create, display or delete a group lab branch for each enlisted project.\n";
  431. print "\nThe arguments are:\n";
  432. print "\n name\tLab branch name. This name is used in the branch\n";
  433. print "\t\tmapping, eg\n\n";
  434. print "\t\t//depot/main/<project>/... //depot/<name>/<project>/...\n";
  435. print "\n -d name\tDeletes the named branch.\n";
  436. print "\n -f\t\tForce; allows administrators to delete any branch.\n";
  437. print "\n -o name\twrites branch spec for named branch to stdout.\n";
  438. print "\nThis command is for Build Labs and Source Depot administrators only.\n";
  439. return;
  440. };
  441. $main::SDCmd eq "label" and do
  442. {
  443. print "\n\nSDX LABEL\n---------\n";
  444. print "Use\n";
  445. print "\n sdx label [-d -f -o] name\n";
  446. print " sdx label -i < labelspec\n";
  447. print "\nto create a label in each depot.\n";
  448. print "\nThe arguments are:\n";
  449. print "\n name\tLabel name.\n";
  450. print "\n -d\t\tDelete the named label.\n";
  451. print "\n -f\t\tForce the delete.\n";
  452. print "\n -i\t\tRead the label spec from stdin.\n";
  453. print "\n -o\t\tDump the label spec to stdout.\n";
  454. &MoreInfo($main::SDCmd);
  455. return;
  456. };
  457. $main::SDCmd eq "labels" and do
  458. {
  459. print "\n\nSDX LABELS\n----------\n";
  460. print "Use\n";
  461. print "\n sdx labels\n";
  462. print "\nto list known labels in each depot.\n";
  463. &MoreInfo($main::SDCmd);
  464. return;
  465. };
  466. $main::SDCmd eq "labelsync" and do
  467. {
  468. print "\n\nSDX LABELSYNC\n-------------\n";
  469. print "Use\n";
  470. print "\n sdx labelsync [-a -d -n] -l label [file[revRange] ...]\n";
  471. print "\nto sync a label to the current client contents.\n";
  472. print "\nThe arguments are:\n";
  473. print "\n -l label\tLabel name to sync.\n";
  474. print "\n -a\t\tAdd files to the label.\n";
  475. print "\n -d\t\tDelete files from the label.\n";
  476. print "\n -n\t\tShow files that would be synced.\n";
  477. &MoreInfo($main::SDCmd);
  478. return;
  479. };
  480. $main::SDCmd eq "opened" and do
  481. {
  482. print "\n\nSDX OPENED\n----------\n";
  483. print "Use\n";
  484. print "\n sdx opened [-a -l -c default] [file ...]\n";
  485. print "\nto show the list of files opened for pending changelists by your client\n";
  486. print "in each project.\n";
  487. print "\nThe arguments are:\n";
  488. print "\n file\tAny valid SD file specification.\n";
  489. print "\n -a\t\tShow files opened by all clients.\n";
  490. print "\n -c default\tShow files open in the default changelist.\n";
  491. print "\n -l\t\tDisplay output using local full paths (not compatible\n";
  492. print "\t\twith -a)\n";
  493. print "\nFor the NT sources, sdx opened will ignore opened files associated with the\n";
  494. print "public change number found in %SDXROOT%\\PUBLIC\\PUBLIC_CHANGENUM.SD.\n";
  495. &MoreInfo($main::SDCmd);
  496. return;
  497. };
  498. $main::SDCmd eq "pending" and do
  499. {
  500. print "\n\nSDX PENDING\n----------\n";
  501. print "Use\n";
  502. print "\n sdx pending\n";
  503. print "\nto \n";
  504. return;
  505. };
  506. =begin comment text
  507. ###
  508. ### remove for rollout
  509. ###
  510. $main::SDCmd eq "privatebranch" and do
  511. {
  512. print "\n\nSDX PRIVATEBRANCH\n-----------------\n";
  513. print "Use\n";
  514. print "\n sdx privatebranch name\n";
  515. print " sdx privatebranch -d [-f] name\n";
  516. print " sdx privatebranch -o name\n";
  517. print "\nto create, display or delete a private development branch for each project\n";
  518. print "you are enlisted in.\n";
  519. print "\nWhen creating a branch, SDX will ask you to edit the branch specification\n";
  520. print "to include only those projects, subdirectories and files that need branching.\n";
  521. print "\nThe arguments are:\n";
  522. print "\n name\tBranch name.\n";
  523. print "\n -d name\tDeletes the named branch.\n";
  524. print "\n -f\t\tForce; allows administrators to delete any branch.\n";
  525. print "\n -o name\twrites branch spec for named branch to stdout.\n";
  526. return;
  527. };
  528. =end comment text
  529. =cut
  530. $main::SDCmd eq "repair" and do
  531. {
  532. print "\n\nSDX REPAIR\n----------\n";
  533. print "Use\n";
  534. print "\n sdx repair [codebase branch]\n";
  535. print " sdx repair -i\n";
  536. print " sdx repair -p file\n";
  537. print "\nto query the source server(s) and repair the enlistment on your local\n";
  538. print "machine. Use this option when you've lost some or all of your enlistment.\n";
  539. print "SDX will determine what you were enlisted in and restore SD.MAP, the SD.INIs\n";
  540. print "in the project roots, and the SD tools.\n";
  541. print "\nThe arguments are:\n";
  542. print "\n codebase\tThe set of sources you're enlisted in, generally the name\n";
  543. print "\t\tof the product you work on. Codebases are described in\n";
  544. print "\t\tPROJECTS.<codebase> in the current directory and on the SDX\n";
  545. print "\t\tserver share from which you enlisted.\n";
  546. print "\n branch\tThe master or group branch you enlisted in originally.\n";
  547. print "\n -i\t\tRewrite SD.INIs only.\n";
  548. print "\n -p file\tRead codebase, branch and projects from file.\n";
  549. print "\n -s\t\tForcibly sync the Tools directory if one exists.\n";
  550. print "\n\nSDX needs to know codebase and branch so it can find the depots. It\n";
  551. print "will look first in \%SDXROOT\%\\SD.MAP, then on the command line or in the\n";
  552. print "profile specified with -p.\n";
  553. print "\nIf your SD/SDX tools are missing, run this command from the server share\n";
  554. print "from which you originally enlisted.\n";
  555. print "\nTo repair a client view that has been heavily modified and now has\n";
  556. print "incorrect mappings, run 'sdx enlist' with -c to restore the default view.\n";
  557. print "This will overwrite any view changes you have made.\n";
  558. return;
  559. };
  560. $main::SDCmd eq "resolve" and do
  561. {
  562. print "\n\nSDX RESOLVE\n-----------\n";
  563. print "Use\n";
  564. print "\n sdx resolve [-af -am -as -at -ay -b -f -n -v] [file ...]\n";
  565. print "\nto merge open files in each project with other revisions or files.\n";
  566. print "\nFor more information and a description of the arguments, run 'sd help resolve'\n";
  567. print "or see the Source Depot User Guide at $main::SDWeb.\n";
  568. &MoreInfo($main::SDCmd);
  569. return;
  570. };
  571. $main::SDCmd eq "resolved" and do
  572. {
  573. print "\n\nSDX RESOLVED\n------------\n";
  574. print "Use\n";
  575. print "\n sdx resolved [file ...]\n";
  576. print "\nto see files in each project that have been successfully integrated but not\n";
  577. print "yet submitted.\n";
  578. print "\nThe [file ...] argument may be any valid SD file specification.\n";
  579. &MoreInfo($main::SDCmd);
  580. return;
  581. };
  582. $main::SDCmd eq "restore" and do
  583. {
  584. print "\n\nSDX RESTORE\n------------\n";
  585. print "Use\n";
  586. print "\n sdx restore [path]\n";
  587. print "\nto \n";
  588. return;
  589. };
  590. $main::SDCmd eq "revert" and do
  591. {
  592. print "\n\nSDX REVERT\n----------\n";
  593. print "Use\n";
  594. print "\n sdx revert file ...\n";
  595. print "\nto discard changes made to one or more files in each project.\n";
  596. print "\nThe file ... argument may be any valid SD file specification.\n";
  597. &MoreInfo($main::SDCmd);
  598. return;
  599. };
  600. $main::SDCmd eq "status" and do
  601. {
  602. print "\n\nSDX STATUS\n----------\n";
  603. print "Use\n";
  604. print "\n sdx status [-q]\n";
  605. print "\nto see files you have opened and files you are out of sync with in each\n";
  606. print "project.\n";
  607. print "\nThe arguments are:\n";
  608. print "\n -q\t\t\tQuiet; suppresses screen output. Does not affect\n";
  609. print "\t\t\toutput logged to file.\n";
  610. return;
  611. };
  612. $main::SDCmd eq "submit" and do
  613. {
  614. print "\n\nSDX SUBMIT\n----------\n";
  615. print "Use\n";
  616. print "\n sdx submit [-r -t] [files] [-# comment text]\n";
  617. print "\nto submit opened files from the default changelist in each depot.\n";
  618. print "\nThe arguments are:\n";
  619. print "\n [files]\t\tA valid SD submit filespec.\n";
  620. print "\n -r\t\t\tUse with reverse-integration submits to check\n";
  621. print "\t\t\tconsistency of change description.\n";
  622. print "\n -t\t\t\tUse with integration submits to check consistency\n";
  623. print "\t\t\tof change description.\n";
  624. print "\n -#\t\t\tSpecifies the change description for all depots and\n";
  625. print "\t\t\tsuppresses the submit form. The comment consists of \n";
  626. print "\t\t\tall text from -# to the end of the command line.\n";
  627. &MoreInfo($main::SDCmd);
  628. return;
  629. };
  630. $main::SDCmd eq "sync" and do
  631. {
  632. print "\n\nSDX SYNC\n--------\n";
  633. print "Use\n";
  634. print "\n sdx sync [-af -am -f -h [-i] -n -q] [file[revRange] ...]\n";
  635. print "\nto sync files to the head or specified revision in each project.\n";
  636. print "\nThe arguments are:\n";
  637. print "\n file[revRange]\tFilespec and revision range.\n";
  638. print "\n -af\t\t\tRuns sd resolve -af on each project after syncing\n";
  639. print "\t\t\tto automatically accept changes. Leaves merge\n";
  640. print "\t\t\tconflicts in files. Useful for automating sync-and-\n";
  641. print "\t\t\tbuild.\n";
  642. print "\n -am\t\t\tRuns sd resolve -am on each project after syncing\n";
  643. print "\t\t\tto automatically accept changes that can be merged\n";
  644. print "\t\t\twithout conflict. Runs sd resolve -n to show files\n";
  645. print "\t\t\tstill needing resolution.\n";
  646. print "\n -f\t\t\tForces resynchronization of files and clobbers\n";
  647. print "\t\t\twriteable files.\n";
  648. print "\n -h\t\t\tShows changelists synchronized instead of files.\n";
  649. print "\n -i\t\t\tUse with -h to also show integration changes.\n";
  650. print "\n -n\t\t\tShows what would be synchronized without actually\n";
  651. print "\t\t\tdoing so.\n";
  652. print "\n -q\t\t\tQuiet; suppresses screen output. Does not affect\n";
  653. print "\t\t\toutput logged to file.\n";
  654. print "\nRun 'sd help sync' and 'sd help resolve' for more information.\n";
  655. return;
  656. };
  657. $main::SDCmd eq "user" and do
  658. {
  659. print "\n\nSDX USER\n--------\n";
  660. print "Use\n";
  661. print "\n sdx user -o [name]\n";
  662. print "\nto show details on the named user in every project.\n";
  663. &MoreInfo($main::SDCmd);
  664. return;
  665. };
  666. $main::SDCmd eq "users" and do
  667. {
  668. print "\n\nSDX USERS\n--------\n";
  669. print "Use\n";
  670. print "\n sdx users\n";
  671. print "\nto list users in each depot.\n";
  672. print "\nThe arguments are:\n";
  673. print "\n -a\tprint summary count only.\n";
  674. print "\n -t\tprint as table sorted by last access time.\n";
  675. &MoreInfo($main::SDCmd);
  676. return;
  677. };
  678. $main::SDCmd eq "where" and do
  679. {
  680. print "\n\nSDX WHERE\n---------\n";
  681. print "Use\n";
  682. print "\n sdx where\n";
  683. print "\nto show how files map through the client view in each project.\n";
  684. &MoreInfo($main::SDCmd);
  685. return;
  686. };
  687. }
  688. # __________________________________________________________________________________
  689. #
  690. # MoreInfo
  691. #
  692. # Parameters:
  693. #
  694. # Output:
  695. # __________________________________________________________________________________
  696. sub MoreInfo
  697. {
  698. print "\nRun 'sd help $_[0]' for more information.\n";
  699. }