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.

516 lines
15 KiB

  1. <HTML>
  2. <HEAD>
  3. <TITLE>sdv</TITLE>
  4. <STYLE><!--
  5. BODY, TABLE { font-family: Arial; font-size: 10pt; }
  6. PRE, CODE { font-family: Lucida Console; }
  7. PRE I { font-family: Arial; }
  8. --></STYLE>
  9. </HEAD>
  10. <BODY>
  11. <H1>sdv</H1>
  12. <P>
  13. A GUI front-end to some Source Depot commands.
  14. <ul>
  15. <li><a href=#cmdli>Command line syntax</a>
  16. <ul>
  17. <li><a href=#chang>sdv changes</a>
  18. <li><a href=#descr>sdv describe</a>
  19. <li><a href=#filel>sdv filelog</a>
  20. <li><a href=#opene>sdv opened</a>
  21. <li><a href=#short>Shortcuts</a>
  22. </ul>
  23. <li><a href=#troub>Troubleshooting</a>
  24. <li><a href=#branc>sdv branch syntax</A>
  25. <li><a href=#psych>sdv special powers</A>
  26. <li><a href=#limit>Limitations</a>
  27. <li>Appendix
  28. <ul>
  29. <li><a href=#ntbrn>Windows NT branch model</A>
  30. </ul>
  31. </ul>
  32. <H2><A NAME=cmdli>Command line syntax</a></H2>
  33. <PRE>
  34. sdv [ options ] command [ arg ... ]
  35. </PRE>
  36. <P>
  37. Some options are common to all sdv commands.
  38. Note that all common options begin with a double-dash and
  39. they come <STRONG>before</STRONG> the command name.
  40. <DL>
  41. <DT><CODE>--s "</CODE><I>sdoptions</I><CODE>"</CODE>
  42. <DD><P>Pass <I>sdoptions</I> directly to sd. See "sd help usage" for
  43. details on sd options. If you need to pass quotation marks
  44. to sd, use double quotation marks.
  45. <P>
  46. Examples:
  47. <PRE>
  48. sdv --s "-p server:4001"
  49. sdv --s "-P ""my password"""
  50. </PRE>
  51. <P>
  52. Note: sdv does not parse these options. It passes them blindly
  53. to sd. The intent of this flag is to allow you to provide
  54. access/authentication information. Passing an option that
  55. alters sd's behavior in a more substantial way
  56. (such as the -V option) will result
  57. in sdv getting extremely confused.
  58. </P>
  59. <DT><CODE>--#</CODE>
  60. <DD><P>Enables computation of "code churn" statistics. If enabled,
  61. reports will include churn information in the form "deleted/added".
  62. For example, a churn value of "5/3" means that five lines were
  63. deleted and three lines were added.
  64. <STRONG>Requires sd 1.5</STRONG>.
  65. <P>
  66. Note: Computing churn is expensive, so it's off by default.
  67. <P>
  68. </DL>
  69. <H3><A NAME=chang>sdv changes</a></H3>
  70. <PRE>
  71. sdv [ options ] changes [-i] [-m [skip,]count] [-u userid] [ pattern ... ]
  72. </PRE>
  73. <P>
  74. Display the results of an "sd changes" command.
  75. <DL>
  76. <DT><I>options</I>
  77. <DD><P><a href=#cmdli>Common sdv options</a> are supported.
  78. </P>
  79. <DT><CODE>-i</CODE>
  80. <DD><P>Has the same effect as the "sd changes -i" option.
  81. </P>
  82. <DT><CODE>-m</CODE><I>skip,count</I>
  83. <DD><P>Has the same effect as the "sd changes -m" option.
  84. If no "-m" flag is provided, sdv defaults to "-m50".
  85. </P>
  86. <DT><CODE>-u</CODE> <I>userid</I>
  87. <DD><P>Has the same effect as the "sd changes -u" option.
  88. <STRONG>Requires sd 1.6; is emulated on previous versions of sd</STRONG>.
  89. </P>
  90. <DT><I>pattern</I>
  91. <DD><P>Zero or more patterns.
  92. </P>
  93. </DL>
  94. <P>
  95. sdv supports the same patterns as sd, with the following differences:
  96. </P>
  97. <UL>
  98. <LI><P>The default pattern is "*" (all files in current directory)
  99. rather than "all files in the depot".
  100. To query against all files in the depot, use
  101. <PRE>
  102. sdv changes ""
  103. </PRE>
  104. to force a null query string to be passed to sd.
  105. </P>
  106. <LI><P><A href=#branc>sdv branch syntax</A> is supported.
  107. </P>
  108. </UL>
  109. <P>
  110. To view the details of a particular changelist, double-click it.
  111. This will open a changelist view.
  112. <P>
  113. Hovering over a change number displays the full change description
  114. as an infotip.
  115. <P>
  116. The "Comment" field is the first line of the checkin description.
  117. So make it a good one!
  118. <P>
  119. To see what else you can do, right-click a change number or
  120. browse the menus.
  121. <H3><A NAME=descr>sdv describe</a></H3>
  122. <PRE>
  123. sdv [ options ] describe changeno [ pattern ... ]
  124. </PRE>
  125. <P>
  126. Display the results of an "sd describe" command.
  127. <DL>
  128. <DT><I>options</I>
  129. <DD><P><a href=#cmdli>Common sdv options</a> are supported.
  130. </P>
  131. <DT><I>changeno</I>
  132. <DD><P>The change list to display.
  133. </P>
  134. <DT><I>pattern ...</I>
  135. <DD><P>Optional list of patterns for files that should be moved to the
  136. top of the file list.
  137. This is provided for scripting; you are not
  138. expected to pass patterns manually.
  139. </P>
  140. </DL>
  141. <P>
  142. From the changelist description, you can double-click the first line
  143. (the one that begins "Change 1234")
  144. to view the entire changelist in windiff.
  145. Alternatively, you can double-click a
  146. specific file to view the diff for only that file.
  147. <P>
  148. You can type Ctrl+C (or for old-timers, Ctrl+Insert) to copy
  149. a line from the changelist view to the clipboard. If you copy
  150. a line from the file list, then the full depot specification
  151. and the revision number are copied. All other lines are copied
  152. verbatim.
  153. <P>
  154. If churn is enabled, each text file that was edited will have the
  155. churn values appended.
  156. <P>
  157. Files which match the pattern (or which are connected to files
  158. matching the pattern via a chain of branch integrations) are
  159. placed at the top of the file list.
  160. <STRONG>Note: Assumes Windows NT branch model</STRONG>.
  161. <P>
  162. If the describe window was opened from another sdv window,
  163. the donor sdv window will set a pattern that causes the files
  164. it thinks you are interested in to go to the top of the file list.
  165. <P>
  166. If churn is enabled, then files with a churn of (0/0) are dropped
  167. to the bottom of the list, since they are rarely interesting.
  168. <P>
  169. To see what else you can do, right-click a line of the changelist
  170. description or browse the menus.
  171. <H3><A NAME=filel>sdv filelog</a></H3>
  172. <PRE>
  173. sdv [ options ] filelog [-# revision] [-m [skip,]count] file[revRange]
  174. </PRE>
  175. <P>
  176. Display the results of an "sd filelog" command.
  177. <DL>
  178. <DT><I>options</I>
  179. <DD><P><a href=#cmdli>Common sdv options</a> are supported.
  180. </P>
  181. <DT><I><CODE>-#</CODE> revision</I>
  182. <DD><P>Optional revision number to autoselect in the results window.
  183. If no "-m" flag is provided, sdv autoselects the most
  184. recent revision.
  185. This is provided for scripting; you are not
  186. expected to specify an autoselect revision when running sdv manually.
  187. </P>
  188. <DT><CODE>-m</CODE><I>skip,count</I>
  189. <DD><P>Has the same effect as the "sd filelog -m" option.
  190. If no "-m" flag is provided, sdv shows all revisions.
  191. </P>
  192. <DT><I>file[revRange]</I>
  193. <DD><P>The file whose log is to be viewed, optionally restricted
  194. with a revision range.
  195. <A href=#branc>sdv branch syntax</A> is supported for this parameter.
  196. Wildcards are not permitted here; you can view the filelog
  197. for only one file at a time.
  198. </P>
  199. </DL>
  200. <P>
  201. From the filelog, you can double-click a
  202. specific revision to view the diff for that change.
  203. <P>
  204. If churn is enabled, each text file that was edited will have the
  205. churn values appended.
  206. <P>
  207. To see what else you can do, right-click a line of the filelog
  208. or browse the menus.
  209. <H3><A NAME=opene>sdv opened</a></H3>
  210. <PRE>
  211. sdv [ options ] opened [ -u domain\user ] [ file ... ]
  212. </PRE>
  213. <P>
  214. Display the opened files on the client, grouped by changelist.
  215. <DL>
  216. <DT><I>options</I>
  217. <DD><P><a href=#cmdli>Common sdv options</a> are supported.
  218. </P>
  219. <DT><CODE>-u</CODE> <I>domain\user</I>
  220. <DD><P>Optional user whose opened files on the client are to be viewed.
  221. Default is the current user.
  222. </P>
  223. <DT><I>file ...</I>
  224. <DD><P>Optional list of files to display. Default is to show all
  225. opened files.
  226. </P>
  227. </DL>
  228. <P>
  229. To see what you can do, right-click a line of the list
  230. or browse the menus.
  231. <H3><A NAME=short>Shortcuts</a></H3>
  232. <P>
  233. If the command line to sdv does not match one of the pattern
  234. described above, then sdv attempts to guess which command you
  235. are trying to execute.
  236. </P>
  237. <TABLE>
  238. <TR><TD><B>You type</B></TD><TD WIDTH=20></TD>
  239. <TD><B>Implied command</B></TD><TD WIDTH=20></TD>
  240. <TD><B>Equivalent to</B></TD></TR>
  241. <TR><TD>sdv 1234</TD><TD></TD><TD>describe</TD><TD></TD><TD>sdv describe 1234</TD></TR>
  242. <TR><TD>sdv file</TD><TD></TD><TD>filelog</TD><TD></TD><TD>sdv filelog file</TD></TR>
  243. <TR><TD>sdv pattern*.c*</TD><TD></TD><TD>changes</TD><TD></TD><TD>sdv changes pattern*.c*</TD></TR>
  244. <TR><TD>sdv -i .../pattern</TD><TD></TD><TD>changes</TD><TD></TD><TD>sdv changes -i .../pattern</TD></TR>
  245. <TR><TD>sdv</TD><TD></TD><TD>changes</TD><TD></TD><TD>sdv changes</TD></TR>
  246. </TABLE>
  247. <P>
  248. Note that these heuristics are not robust. For example, if you
  249. have a file called "1234", then "sdv 1234" will be interpreted
  250. as "sdv describe 1234" and not
  251. "sdv filelog 1234".
  252. Or if you
  253. have a file called "changes", then "sdv changes" will be interpreted
  254. as "sdv changes" with no arguments rather than as
  255. "sdv filelog changes".
  256. <P>
  257. To avoid these problems, just give the command explicitly
  258. instead of relying on a shortcut.
  259. <H2><A NAME=troub>Troubleshooting</A></H2>
  260. If you get an error from windiff saying that it doesn't support
  261. depot paths on the command line, then you need a newer version
  262. of windiff.
  263. <H2><A NAME=branc>sdv branch syntax</A></H2>
  264. <P>
  265. sdv supports an enhancement to the standard sd file specifications
  266. to allow easy navigation of branches.
  267. <STRONG>Note: Assumes your depot follows the Windows NT branch model</STRONG>.
  268. <P>
  269. If you prefix a pattern with
  270. a branch name and a colon, the file is reinterpreted to come from
  271. the specified branch rather than from the current directory.
  272. If the branch name begins with a slash, then the branch name is
  273. a private branch. Otherwise, it is a top-level (official) branch.
  274. <P>
  275. (Branch names must be at least two characters long to prevent the
  276. branch syntax from being misinterpreted as a drive letter.)
  277. <P>
  278. The following examples assume that the current directory corresponds
  279. to //depot/exp/sdv.
  280. </P>
  281. <TABLE>
  282. <TR><TD><B>Pattern</B></TD><TD WIDTH=20></TD><TD><B>Expands to</B></TD></TR>
  283. <TR><TD>sdv.h</TD><TD></TD><TD>//depot/exp/sdv/sdv.h</TD></TR>
  284. <TR><TD>main:sdv.h</TD><TD></TD><TD>//depot/main/sdv/sdv.h</TD></TR>
  285. <TR><TD>/office:sdv.h</TD><TD></TD><TD>//depot/private/office/sdv/sdv.h</TD></TR>
  286. <TR><TD COLSPAN=3>&nbsp;</TD></TR>
  287. <TR><TD>...</TD><TD></TD><TD>//depot/exp/sdv/...</TD></TR>
  288. <TR><TD>main:...</TD><TD></TD><TD>//depot/main/sdv/...</TD></TR>
  289. <TR><TD>/office:...</TD><TD></TD><TD>//depot/private/office/sdv/...</TD></TR>
  290. <TR><TD COLSPAN=3>&nbsp;</TD></TR>
  291. <TR><TD>../bbpack/*.cmd</TD><TD></TD><TD>//depot/exp/bbpack/*.cmd</TD></TR>
  292. <TR><TD>main:../bbpack/*.cmd</TD><TD></TD><TD>//depot/main/bbpack/*.cmd</TD></TR>
  293. <TR><TD>/office:../bbpack/*.cmd</TD><TD></TD><TD>//depot/private/office/bbpack/*.cmd</TD></TR>
  294. </TABLE>
  295. <H2><A NAME=psych>sdv special powers</A></H2>
  296. <P>
  297. sdv was bitten by a radioactive spider and has as a consequence
  298. been imbued with <I>special powers</I> that sometimes come in handy.
  299. <H3>Net use'd to another enlistment</H3>
  300. sdv detects that the current
  301. directly belongs to somebody else's enlistment and fiddles the
  302. parameters that it sends to sd so the "right" thing happens.
  303. Normally, sd bails with an error message like
  304. <PRE>
  305. Path 'Z:\' is not under client's root 'C:\src'.
  306. </PRE>
  307. <H3>Gauntlet</H3>
  308. <P>
  309. sdv has special knowledge of the
  310. <A HREF=http://toolbox/search/tbdetail.asp?ToolID=1086>
  311. Gauntlet</A> checkin process and
  312. displays Gauntlet checkins as if they had been checked
  313. in by the submitting developer (rather than by the Gauntlet machine).
  314. <H3>proxy checkins</H3>
  315. <P>
  316. sdv recognizes the following patterns at the start of a checkin
  317. description and treats them as proxy checkins.
  318. <PRE>
  319. 123456 (developer) comment
  320. 123456 [developer] comment
  321. (developer) comment
  322. [developer] comment
  323. </PRE>
  324. <H3>RAID bugs</H3>
  325. <P>
  326. sdv sniffs around the checkin comment looking for things which might
  327. be bug numbers. When it finds one, it will offer to view the RAID bug
  328. as a web page. By default, the bug is interpreted as a bug in the
  329. Windows NT database. You can override this by setting the SDVRAID
  330. environment variable. Its value is a command line to execute,
  331. with a "#" where the bug number should go. (Typically a program with
  332. arguments or an URL.)
  333. <P>
  334. For example, you might use
  335. <PRE>
  336. set SDVRAID=http://www.imdb.com/Title?#
  337. </PRE>
  338. to cause bugs to link to random movies from the Internet Movie Database.
  339. (Well, except that if your database has more bugs than the IMDb has movies,
  340. you'll end up with a bunch of broken links, but this was just a joke
  341. suggestion anyway.)
  342. <H2><A NAME=limit>Limitations</A></H2>
  343. <UL>
  344. <LI><P>
  345. The branch resolver will get confused if you try to apply it to something
  346. that doesn't have a branch name. For example, if you type
  347. <PRE>
  348. main://depot/.../i386/...
  349. </PRE>
  350. then you deserve what you get.
  351. </P>
  352. <LI><P>
  353. The branch resolver and the code that tries to figure out borrowed
  354. enlistments can get faked out by complicated client views
  355. which move directories around or edit filenames.
  356. </P>
  357. <LI><P>
  358. The code that tries to figure out borrowed enlistments will fail if
  359. your client root is set to the null string. If you are perverse
  360. enough to do this, then you deserve what you get.
  361. </P>
  362. <LI><P>
  363. Only the first bug number found is auto-linked by the bug number sniffer.
  364. For the others, you will have to type the bug number into Raid manually.
  365. This will teach you not to batch fixes for multiple bugs into a single
  366. changelist.
  367. </P>
  368. <LI><P>
  369. If multiple integrations to a file are
  370. submitted as a single change, only one of them will be displayed
  371. in the "filelog" list. Fortunately, very few people do this, but if you
  372. are one of those people, consider yourself warned.
  373. This is arguably a bug, but fixing it is tricky so I'm going to wait
  374. and see if anybody complains.
  375. </P>
  376. </UL>
  377. <H2>Appendix</H2>
  378. <H3><A NAME=ntbrn>Windows NT branch model</A></H3>
  379. <UL>
  380. <LI><P>//depot/branchname/... are
  381. official, or "top-level" branches.
  382. The main branch is called "main".
  383. </P>
  384. <LI><P>//depot/private/branchname/...
  385. are private branches.
  386. </UL>
  387. <P>
  388. The file hierarchies under each branch are identical. In other
  389. words, the branch specifications are always of the form
  390. <PRE>
  391. //depot/donor/aaaa/... //depot/recipient/aaaa/...
  392. //depot/donor/bbbb/cccc/... //depot/recipient/bbbb/cccc/...
  393. </PRE>
  394. where "donor" and "recipient" are either a top-level branch name
  395. or a private branch name in the form "private/name".
  396. <P>
  397. These rules make it relatively easy to track the relationships
  398. between files because you can determine whether two files are
  399. connected via branch integrations just by looking at their full depot
  400. paths:
  401. <PRE>
  402. //depot/W/aaa/bbb/ccc/ddd
  403. //depot/X/aaa/bbb/ccc/ddd
  404. //depot/private/Y/aaa/bbb/ccc/ddd
  405. //depot/private/Z/aaa/bbb/ccc/ddd
  406. </PRE>
  407. are all related to each other by chains of integrations.
  408. </BODY>
  409. </HTML>