summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/svninfo/svninfo.dtx
blob: 8135a16abf31f7b4dba24be3654512e7fd9b57b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339

% \iffalse
%<*header>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%% `svninfo' package to use with LaTeX2e.
%%
%% This package is used to extract the revision and file information provided
%% by the Subversion revision control system.
%%
%% Copyright (C) 1995 Dr. Juergen Vollmer
%% Copyright (C) 2003-2007 Achim D. Brucker
%%
%% License:
%%   This program can be redistributed and/or modified under the terms
%%   of the LaTeX Project Public License Distributed from CTAN
%%   archives in directory macros/latex/base/lppl.txt; either
%%   version 1 of the License, or any later version.
%%
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%
%\iffalse
% to test the checksum, uncomment    \OnlyDescription
% in the driver
%\fi
%
%% \CheckSum{628}
%% \CharacterTable
%%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
%%   Digits        \0\1\2\3\4\5\6\7\8\9
%%   Exclamation   \!     Double quote  \"     Hash (number) \#
%%   Dollar        \$     Percent       \%     Ampersand     \&
%%   Acute accent  \'     Left paren    \(     Right paren   \)
%%   Asterisk      \*     Plus          \+     Comma         \,
%%   Minus         \-     Point         \.     Solidus       \/
%%   Colon         \:     Semicolon     \;     Less than     \<
%%   Equals        \=     Greater than  \>     Question mark \?
%%   Commercial at \@     Left bracket  \[     Backslash     \\
%%   Right bracket \]     Circumflex    \^     Underscore    \_
%%   Grave accent  \`     Left brace    \{     Vertical bar  \|
%%   Right brace   \}     Tilde         \~}
%</header>
%\fi

% \DoNotIndex{\begin,\CodelineIndex,\CodelineNumbered,\def,\DisableCrossrefs}
% \DoNotIndex{\DocInput,\documentclass,\EnableCrossrefs,\end,\GetFileInfo}
% \DoNotIndex{\NeedsTeXFormat,\OnlyDescription,\RecordChanges,\usepackage}
% \DoNotIndex{\ProvidesClass,\ProvidesPackage,\ProvidesFile,\RequirePackage}
% \DoNotIndex{\LoadClass,\PassOptionsToClass,\PassOptionsToPackage}
% \DoNotIndex{\DeclareOption,\CurrentOption,\ProcessOptions,\ExecuteOptions}
% \DoNotIndex{\AtEndOfClass,\AtEndOfPackage,\AtBeginDocument,\AtEndDocument}
% \DoNotIndex{\InputIfFileExists,\IfFileExists,\ClassError,\PackageError}
% \DoNotIndex{\if,\else,\fi,\emph,\footnotesize,\footrulewidth,\let}
% \DoNotIndex{\newcount,\newif,\number,\or,\parindent,\plainfootrulewidth}
% \DoNotIndex{\PrintChanges,\PrintIndex,\relax,\setlength,\space}
% \DoNotIndex{\the,\textwidth,\thepage,\newcommand,\texttt,\verb,\vfill}
% \DoNotIndex{\input,\newpage,\setcounter,\newcounter,\\,\ ,\typeout,\today}
%
% \MakeShortVerb{\|}
% \newcommand{\LatexToHtml}{\LaTeX 2\texttt{HTML}}
% \def\param#1{\texttt{\##1}}
% \newcommand{\Cmd}[1]{\texttt{$\backslash$#1}}
% \newcommand{\Svn}{\emph{Subversion}}
% \newcommand{\Svk}{\emph{svk}}
% \newcommand{\blank}{{\tiny$_\sqcup$}}
% \newcommand{\Id}{\texttt{\$Id\$}}
% \newcommand{\SvnInfoCmd}[1]{\texttt{$\backslash$svnInfo\blank\$Id#1\$\blank}}
%
% \changes{v0.7}{2007/03/26}{Added option \texttt{margin} for showing
% version info in the margins of the document; added option
% \texttt{svk} for supporting the keyword expansion of svk; added command 
% \texttt{\\svnMaxToday}; and fixed the use of \texttt{fancyhdr} for 
% single-sided documents.}
% \changes{v0.6}{2006/05/11}{Added \texttt{\\svnInfoMinRevision} and
% \texttt{\\svnInfoMaxRevision} together with the option
% \texttt{revrange}. Also added support for \texttt{\textbackslash} in keywords.}
% \changes{v0.5}{2006/01/11}{Removed support for \LatexToHtml{} (it is
%   non-free software and also seems to be unmaintained) and added new
%   command \texttt{\\svnKeyword} for defining arbitrary svn keywords
%   (e.g. \texttt{\string$Author:\string$}).}
% \changes{v0.4}{2005/11/07}{Added new package options \texttt{draft}, \texttt{final}, 
%                            \texttt{eso-foot}, and \texttt{scrpage}. Fixed problem 
%                            with `\_' in file names.}
% \changes{v0.3}{2005/09/30}{Added support for \texttt{\$Id:\$} keywords without
% owner information.}
% \changes{v0.2.1}{2005/04/07}{Added \texttt{\\svnId}.}
% \changes{v0.2}{2005/01/17}{Removed \LatexToHtml{} build-dependency.}
% \changes{v0.1}{2003/08/14}{Initial version, mainly a modified version 
%                            of the \texttt{rcsinfo} package.}
%
% \title{The \texttt{svninfo} package}
% \author{Achim D.~Brucker\\
%         {\footnotesize brucker@freiburg.linux.de}\\
%         {\footnotesize http://www.brucker.ch/}}
% \date{March 26, 2007\\Version 0.7}
%
% \maketitle
%
% \begin{abstract}
%   \noindent This package is used to extract the revision and file
%   information provided by the \Svn\
%   (\texttt{http://subversion.tigris.org}) and the \Svk\
%   (\texttt{http://svk.elixus.org}) revision control system.
% \end{abstract}
%
%\section{Introduction}
%
% To maintain different versions of a document or to keep track on the
% development of one, the document is kept under a revision control
% system like \emph{SCCS}, \emph{CVS}, or \Svn.  This package assumes
% you are using either the \Svn\ or the \Svk\ system.  To present the
% version information of a document, one needs to extract it from some

% \Svk\ offer therefore several keywords that are expanded by the
% \Svn\ and \Svk\ \emph{update} commands. The most informative keyword
% is |$Id$| which contains a lot of useful information. This
% information is made available through this package. Additionally,
% the package allows one to extract also the information from the more
% specific keywords, e.g., |$Author$| or |$Date$|.
%
% In this documentation we we \Svn in the examples; but the results
% should be similar if you use \Svk. Note that you to use the
% \texttt{svk} option if you use \Svk.
%
% The information obtained from the expanded \Id\ string are
% \begin{itemize}
% \item the filename,
% \item the revision number,
% \item the date and time of the last \Svn\ \emph{co} command, and
% \item name of the user who has done this action.
% \end{itemize}
% For each of these items a macro is defined.
% When \emph{updating} a file, the \Svn\ keywords should be contained in
% the \emph{updated} source. Further, one has to set the \Svn\ property 
% for keyword expansion of that file, e.g.\ 
% \begin{verbatim}
% svn propset svn:keywords "Id" svninfo.dtx
% \end{verbatim}
% See the \Svn\ documentation for more details. 
%
% If you want to read about the implementation, put a \% before
% |\Only|\-|Description| in the code marked with |<*driver>| in the file
% |svninfo.dtx|.
%
%\section{User Interface}
%
%\subsection{Options}
%
% Options for this package are:
%
% \begin{description}
% \item[svk]
%      Use  \texttt{svk} for parsing the Id information generated by
%      \Svk.
% \item[today]
%      Set the date of |\svnToday| to the date obtained by the \Svn\ information.
%      If the \Id\ string is not expanded (see below), the current date is
%      used.
% \item[notoday]
%      Don't use the \Svn\ date for |\svnToday|.
% \item[revrange] For multi-file documents, display minimum and
%      maximium revision. Every file of the document must either
%      include a |\svnInfo| or a |\svnKeyword $Revision:$| statement.
%      This is information needs two runs of \LaTeX{} to be correct.
% \item[fancyhdr]
%      We use the \texttt{fancyhdr} package to fill the footline with
%      \Svn\ information: filename, revision-number and date.
%
%      If the \texttt{fancyhdr} package is not already loaded, it will be
%      loaded
%      by this package. To use the footnotes, put something like:\\
%      \hspace*{1em}|\pagestyle{fancyplain}|\\
%      \hspace*{1em}|\fancyhead[RE,LO]{\leftmark}|\\
%      \hspace*{1em}|\fancyhead[LE,RO]{\thepage}|\\
%      in the preamble.
% \item[nofancy]
%      We don't define the footline. The 
%      \texttt{fancyhdr} package is not loaded.
% \item[scrpage2]
%      Use  \texttt{scrpage2} instead of \texttt{fancyhdr}.
% \item[eso-foot]
%      Use  \texttt{eso-pic} for showing a tiny info line at the bottom 
%      line of the paper.
%    \item[margin] Use \texttt{margin} for showing the version info in
%      the margin area.
% \item[long]
%      If used together with \texttt{fancy} / \texttt{fancyhdr} the date
%      string is printed in the long format
%      as |\svnToday| returns it. If \texttt{fancy} / \texttt{fancyhdr}
%      is not used, nothing.
% \item[short]
%      If used together with \texttt{fancy} / \texttt{fancyhdr} the date
%      string is printed in the short
%      format \emph{YYYY-MM-DD}.
%      If \texttt{fancy} / \texttt{fancyhdr} is not used, nothing.
% \item[final] Don't define the footline. If you want the \Svn\ in the 
%      final document, please use\\
%      \verb|\usepackage{draft}| 
% \item[draft] If \texttt{nofancy} is not used, show a footline with \Svn information.
% \end{description}
% If the \texttt{babel} package is used, the |\svnToday| string is language
% dependent.
%
% The default options are: \emph{draft,today,long}. You may also
% configure the default fancy heading packages in the configuration
% file |svninfo.cfg|.
%
%\subsection{Commands}
%
% \subsubsection{Defining the \Svn\ Id information}
%
% There is only one macro to define the information:
% |\svnInfo|\DescribeMacro{\svnInfo}.  Since it must collaborate with
% \Svn\ it has an ``unusual'' calling sequence: The arguments are
% prefaced with a `\$' and completed with a `\$\blank' (note the final
% space or carriage return).
% The following arguments are valid:\\
% \hspace*{0.5em} \SvnInfoCmd{}\\
% \hspace*{0.5em} \SvnInfoCmd{:}\\
% \hspace*{0.5em}
% \SvnInfoCmd{:\blank\emph{file}\blank\emph{rev}\blank\emph{YYYY-MM-DD}\blank\emph{hh:mm:ss}\blank\emph{owner}\blank}
%
% In the first two forms, \Svn\ has not expanded the \Id\ string.
% This form will usually be used before the file is \emph{checked in}
% the first time.
%
% \emph{YYYY-MM-DD} is a date, \emph{hh:mm:ss} a time.
% Note: when you perform the \Svn\ \emph{check out} command, the \Id\ string
% is expanded by \Svn\ automatically.
%
% To take effect, |\svnInfo| must follow the |\begin{document}|.
% If you are using multiple files for a document, you could place
% |\svnInfo| at the
% beginning of each file, so the information from the current file is
% obtained.
%
% \subsubsection{Accessing the \Svn\ Id  information}
% There are the following macros to access the information provided by \Svn.
% If \Svn\ has not expanded the \Id\ string, or no |\svnInfo| command is given,
% default values are returned.
%
% \begin{itemize}
% \item \DescribeMacro{\svnInfoFile} The name of the source file.
%        Default: \texttt{--sourcefile--}.
% \item \DescribeMacro{\svnInfoRevision} The revision number, of the
%       \emph{checked out} file.
%       Default: \texttt{--revision--}.
% \item \DescribeMacro{\svnInfoMinRevision} The minimum revision
% number of multi-file documents. Every file of the document must either
%      include a |\svnInfo| or a |\svnKeyword $Revision:$| statement.
%      This is information needs two runs of \LaTeX{} to be correct.
%       Default: \texttt{--minrevision--}.
% \item \DescribeMacro{\svnInfoMaxRevision} The maximum revision
% number of multi-file documents. Every file of the document must either
%      include a |\svnInfo| or a |\svnKeyword $Revision:$| statement.
%      This is information needs two runs of \LaTeX{} to be correct.
%       Default: \texttt{--maxrevision--}.
% \item \DescribeMacro{\svnInfoDate} The date in the form \emph{YYYY-MM-DD},
%       when the file was \emph{checked out}. 
%       Default: the current date.
% \item \DescribeMacro{\svnInfoTime} The time, when the file was
%       \emph{checked out}.
%       Default: \texttt{--time--}.
% \item \DescribeMacro{\svnInfoOwner} The user name of the file owner.
%       Default: \texttt{--owner--}.
% \item \DescribeMacro{\svnInfoYear} The year \emph{YYYY} of |\svnInfoDate|.
%       Default: the current year.
% \item \DescribeMacro{\svnInfoMonth} The month \emph{MM} of |\svnInfoDate|.
%       Default: the current month.
% \item \DescribeMacro{\svnInfoDay} The day \emph{DD} of |\svnInfoDate|.
%       Default: the current day.
% \item \DescribeMacro{\svnInfoLongDate} The date in the form of |\today|
%       when the file was \emph{checked out}. This is language depended.
%       Default: the current date.
% \item \DescribeMacro{\svnId} Mimics the behavior of the \Id\ strings, i.e.\ it
%       prints a string with a summary of the above described
%       information. 
% \item \DescribeMacro{\svnToday} The date obtained from the \Svn\ information 
%       in the format |\today| is using.
% \item \DescribeMacro{\svnMaxToday} The date obtained from the latest
%       \Svn revision in the format |\today| is using, e.g., you can
%       use something like |\date{\svnMaxToday}| in your preample.
% \end{itemize}
% \section{Examples}
%
% \newcommand{\svnExample}{
% \begin{tabular}[t]{rl}
% \Cmd{svnInfoFile}     & \svnInfoFile     \\
% \Cmd{svnInfoRevision} & \svnInfoRevision \\
% \Cmd{svnInfoMinRevision} & \svnInfoMinRevision \\
% \Cmd{svnInfoMaxRevision} & \svnInfoMaxRevision \\
% \Cmd{svnInfoDate}     & \svnInfoDate     \\
% \Cmd{svnInfoTime}     & \svnInfoTime     \\
% \Cmd{svnInfoOwner}    & \svnInfoOwner    \\
% \end{tabular}
% \begin{tabular}[t]{rl}
% \Cmd{svnInfoYear}     & \svnInfoYear     \\
% \Cmd{svnInfoMonth}    & \svnInfoMonth    \\
% \Cmd{svnInfoDay}      & \svnInfoDay      \\
% \Cmd{svnInfoLongDate} & \svnInfoLongDate \\
% \Cmd{svnToday}           & \svnToday           \\
% \Cmd{svnMaxToday}           & \svnMaxToday           \\
% \end{tabular}\\
% \Cmd{svnId} \svnId
% \bigskip
%}
%
% \svnInfo $Id$
% |\svnInfo| not expanded, no colon\\
% \verb+\svnInfo $+\verb+Id$+\\
% \svnExample
%
% \svnInfo $Id:$
% |\svnInfo| not expanded, having colon\\
% \verb+\svnInfo $+\verb+Id:$+\\
% \svnExample
%
% \svnInfo $Id: svninfo.dtx 1168 2005-04-08 06:18:47Z brucker $
% |\svnInfo| standard version\\
% {\small\verb+\svnInfo $Id: svninfo.dtx 1168 2005-04-08 06:18:47Z brucker $+}\\
% \svnExample
% 
% \svnInfo $Id: svninfo.dtx 1168 2005-04-08 06:18:47Z $
% |\svnInfo| standard version without owner\\
% {\small\verb+\svnInfo $Id: svninfo.dtx 1168 2005-04-08 06:18:47Z $+}\\
% \svnExample
%
% \svnInfo $Id: svninfo.dtx 1168 2005-04-08 06:18:47Z infsec\brucker $
% |\svnInfo| standard version with \\ in the owner \\
% {\small\verb+\svnInfo $Id: svninfo.dtx 1168 2005-04-08 06:18:47Z brucker $+}\\
% \svnExample
% 
% \svnInfo Id: svninfo.dtx 12 2002-04-19 12:27:55 brucker $
% |\svnInfo| no leading \$\\
% {\footnotesize\verb+\svnInfo Id: svninfo.dtx 12 2002-04-19 12:27:55 brucker $+}\\
% \svnExample
%
% \section{The generic \Svn\ keyword interface}
% In addition to the already presented |\svnInfo| macro which is
% specially built for analyzing the \Svn |$Id$| information we also
% provide a generic interface via
% |\svnKeyword|\DescribeMacro{\svnKeyword}. This interface can
% be used to extract information from the remaining keywords:
% \begin{itemize}
% \item |$Date$|: The date of the last commit with changes. This
%   information can also be accessed using the keyword
%   |$LastChangedDate$|.
% \item |$Revision$|: The revision of the last commit with
%   changes. This information can also be accessed using the keyword
%   |$LastChangedRevision$| or |$Rev$|.
% \item |$Author$|: The author of the last commit with changes. This
%   information can also be accessed using the keyword
%   |$LastChangeBy$|.
% \item |$HeadURL$|: The the full URL to the latest version of the
%   file in the repository. This information can also be accessed
%   using the keyword |$URL$|.
% \end{itemize}
% These keywords can be accessed using the |\svnKeyword|
% macro. This macro accepts a single argument that should be of the
% form |$|\meta{Keyword}|$| (unexpanded) or
% |$|\meta{Keyword}:\blank\meta{value}\blank|$| (expanded), e.g.:
% \begin{verbatim}
% \svnKeyword $Author: brucker $
% \end{verbatim}
% The |\svnKeyword| updates the corresponding \Svn\ Id
% information, e.g., our example updates |\svnInfoOwner|. In more
% detail:
% \begin{itemize}
% \item |\svnKeyword $Date:$| updates the date and time
%   informations, e.g., |\svnInfoDate|\DescribeMacro{\svnInfoDate},
%   |\svnInfoMonth|\DescribeMacro{\svnInfoMonth}, or
%   |\svnInfoTime|\DescribeMacro{\svnInfoTime}.
% \item |\svnKeyword $Revision:$| updates
%   |\svnInfoRevision|\DescribeMacro{\svnInfoRevision}.
% \item |\svnKeyword $Author:$| updates
%   |\svnInfoOwner|\DescribeMacro{\svnInfoOwner}.
% \item |\svnKeyword $HeadURL:$| updates
%   |\svnInfoHeadURL|\DescribeMacro{\svnInfoHeadURL}.
% \end{itemize}
%
% Note, the parser used by |\svnKeyword| is not that powerful than
% the one used by |\svnInfo|. Thus it is advisable to use
% |\svnKeywordId| for the |$Id$| keyword and |\svnKeyword|
% only for the keywords described in this section.
%
% Further, the |\svnKeyword| macro does not reset all keyword
% definitions globally, i.e., you can combine the |$Revision$| 
% of one file, with the |$Author$| of another file. Please take
% care of that!
% 
% \section{Acknowledgements}
% %%%%%%%%%%%%%%%%%%%%%%%%%
% This package is based on \texttt{rcsinfo} from Dr.~J{\"u}rgen
% Vollmer. The \texttt{rcsinfo} package is distributed via the CTAN
% archives ('\texttt{macros/latex/contrib/rcsinfo}').
%
% The code for parsing generic \Svn{} keywords was taken from the
% \texttt{svn} packages written by Richard Lewis. The \texttt{svn}
% package is distributed via the CTAN archives
% ('\texttt{macros/latex/contrib/svn}').
%
% Further I want to thank all the people that reported bugs and ideas
% for improvements, often including patches: Christophe Jacquet, Jami
% Lawrence, Stefan Mann, Nigel Metheringham, Michael Niedermair, Heiko
% Oberdiek, Bernd Raichle, J\"org Sommer, Arnout Standaert, Daniel
% Tr\"umper, Thomas Weber, and Uwe Ziegenhagen.
%
% \section{Copyright and License}
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% \begin{tabular}{ll}
% Copyright (\copyright) 1995 & Dr. J{\"u}rgen Vollmer\\
% Copyright (\copyright) 2003--2007 & Achim D.~Brucker \texttt{brucker@freiburg.linux.de}\\
% \end{tabular}
%
% \noindent This program can be redistributed and/or modified under
% the terms of the \LaTeX{} Project Public License Distributed from
% CTAN archives in directory '\texttt{macros/latex/base/lppl.txt}';
% either version 1 of the License, or any later version.
%
% \StopEventually{}
%
% \section{The Documentation Driver File}
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% The next bit of code contains the documentation driver file for
% \TeX\, i.e., the file that will produce the documentation you are
% currently reading. It will be extracted from this file by the
% \texttt{docstrip} program.
%
% If you want to read about the implementation, put a \% before
% |\OnlyDescription| in the following code.
%    \begin{macrocode}
%<*driver>
\documentclass{article}
\usepackage{doc}
\usepackage[nofancy]{svninfo}
\OnlyDescription
\makeatletter
\if@svnInfoUseFancyhdr@
\pagestyle{fancyplain}
\if@twoside
\fancyhead[RE,LO]{\leftmark}
\fancyhead[LE,RO]{\thepage}
\else
\fancyhead[R]{\leftmark}
\fancyhead[L]{\thepage}
\fi
\fi
\makeatother
\RecordChanges
\EnableCrossrefs
\CodelineIndex
\begin{document}
\DocInput{svninfo.dtx}
\PrintChanges
\setcounter{IndexColumns}{2}
\PrintIndex
\end{document}
%</driver>
%    \end{macrocode}
%
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% \section{The Configuration File}
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% You can set up the default fancy headings package in the file
% |svninfo.cfg|.
% Use the |fancyhdr| package, by setting the default option: |fancyhdr|.
%    \begin{macrocode}
%<*config>
\ExecuteOptions{fancyhdr}
%</config>
%    \end{macrocode}
%
%
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% \section{The Implementation}
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% The implementation is based on cracking the \Id\ string. 
%
% What do we need, and who we are:
%    \begin{macrocode}
%<*package>
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{svninfo}[2007/03/26 v0.8]
%    \end{macrocode}
%
% Declare some local counters to store the \Svn\ date
%    \begin{macrocode}
\newcount\@svnInfoDay
\newcount\@svnInfoMonth
\newcount\@svnInfoYear
\newcount\@svnInfoMaxDay
\newcount\@svnInfoMaxMonth
\newcount\@svnInfoMaxYear
%    \end{macrocode}
%
% To memorize, that we want to set |\svnToday| to the date obtained by the
% \Svn\ information.
%    \begin{macrocode}
\newif\if@svnInfoToday@
%    \end{macrocode}
%
% |\svnToday| should return the date obtained by the \Svn\ information.
%    \begin{macrocode}
\DeclareOption{today}{
  \@svnInfoToday@true
}
%    \end{macrocode}
%
% Ok we don't want do use it.
%    \begin{macrocode}
\DeclareOption{notoday}{
  \@svnInfoToday@false
}
%    \end{macrocode}
% To memorize if we should show ranges of revision (for multiple-file
% documents):
%    \begin{macrocode}
\newif\if@svnInfoRevRange@
\@svnInfoRevRange@false
%    \end{macrocode}
%    \begin{macrocode}
\DeclareOption{revrange}{
  \@svnInfoRevRange@true
}
%    \end{macrocode}
%    \begin{macrocode}
% To memorize if we are in final or draft mode:
%    \begin{macrocode}
\newif\if@svnInfoDraft@
%    \end{macrocode}
%    \begin{macrocode}
\DeclareOption{final}{
  \@svnInfoDraft@false
}
\DeclareOption{draft}{
  \@svnInfoDraft@true
}
%    \end{macrocode}
%
% To memorize, that we want to have the old \texttt{fancyheadings}, the new
% \texttt{fancyhdr}, \texttt{srcpage2}, \texttt{eso-pic}, or \texttt{margin}. 
% footline filled with \Svn\ information.
%    \begin{macrocode}
\newif\if@svnInfoNotPreamble@%
\@svnInfoNotPreamble@false%
\newif\if@svnInfoUseFancy@
\newif\if@svnInfoUseFancyhdr@
\newif\if@svnInfoUseScrpage@
\newif\if@svnInfoUseEsofoot@
\newif\if@svnInfoUseMargin@
\newif\if@svnInfoSVK@
%    \end{macrocode}
%
% We want to use the \texttt{fancyhdr}
% package, and set the footline with the \Svn\ information.
% Only one option may be in effect.
%    \begin{macrocode}
\DeclareOption{fancy}{
  \@svnInfoUseFancy@true
  \@svnInfoUseFancyhdr@false
  \@svnInfoUseScrpage@false
  \@svnInfoUseEsofoot@false
}
\DeclareOption{fancyhdr}{
  \@svnInfoUseFancy@false
  \@svnInfoUseFancyhdr@true
  \@svnInfoUseScrpage@false
  \@svnInfoUseEsofoot@false
}
\DeclareOption{scrpage}{
  \@svnInfoUseFancy@false
  \@svnInfoUseFancyhdr@false
  \@svnInfoUseScrpage@true
  \@svnInfoUseEsofoot@false
}
\DeclareOption{eso-foot}{
  \@svnInfoUseFancy@false
  \@svnInfoUseFancyhdr@false
  \@svnInfoUseScrpage@false
  \@svnInfoUseEsofoot@true
}
\DeclareOption{margin}{
  \@svnInfoUseMargin@true
}
\DeclareOption{svk}{
  \@svnInfoSVK@true
}
%    \end{macrocode}
%
% Ok we don't want do use it.
%    \begin{macrocode}
\DeclareOption{nofancy}{
  \@svnInfoUseFancy@false
  \@svnInfoUseFancyhdr@false
  \@svnInfoUseScrpage@false
  \@svnInfoUseEsofoot@false
}
%    \end{macrocode}
%
% To memorize, that we want to use the long date format.
%    \begin{macrocode}
\newif\if@svnInfoLong@
%    \end{macrocode}
%
% We want to use the long date format.
%    \begin{macrocode}
\DeclareOption{long}{
  \@svnInfoLong@true
}
%    \end{macrocode}
%
% Ok we don't want do use it.
%    \begin{macrocode}
\DeclareOption{short}{
  \@svnInfoLong@false
}
%    \end{macrocode}
%
% Use these default options,
%    \begin{macrocode}
\ExecuteOptions{draft,today,long}
%    \end{macrocode}
%
% read the configuration file, to set the default fancy headings package,
%    \begin{macrocode}
\IfFileExists{svninfo.cfg}{\input{svninfo.cfg}}{}
%    \end{macrocode}
%
% and the process the user options.
%    \begin{macrocode}
\ProcessOptions*\relax
%    \end{macrocode}
% Load packages for page headers of footers if necessary.
%    \begin{macrocode}
\if@svnInfoDraft@   
    \if@svnInfoUseFancy@   
        \RequirePackage{fancyheadings}
    \fi
    \if@svnInfoUseFancyhdr@
        \RequirePackage{fancyhdr}
    \fi
    \if@svnInfoUseScrpage@
        \RequirePackage{scrpage2}
    \fi
    \if@svnInfoUseEsofoot@
        \RequirePackage{eso-pic}
    \fi
\fi 
%    \end{macrocode}
% 
%    \begin{macrocode}
\RequirePackage{ifthen}
%    \end{macrocode}
%
% If no language for the |babel| package is given in the document,
% we have to redefine |\svnToday| (otherwise the changed |\year|, |\month| and
% |\day| won't work). In this case use the English version of |\svnToday|.
%    \begin{macrocode}
\def\svnToday{\ifcase\month\or
  January\or February\or March\or April\or May\or June\or
  July\or August\or September\or October\or November\or December\fi
  \space\number\day, \number\year}
%    \end{macrocode}
%
% We have a problem, since the number of arguments of |\svnInfo| vary from
% zero to five.
% To deal with that, we use some kind ``continuation passing'' style of
% programming.
% |\@svnInfoNext| contains the action to be done next.
%

%\begin{macro}{\svnInfo}
% Extract the \Svn\ information, and give commands shown above their values.
% Check the catcode of |:| and set the flag. The restoration is done after the
% |:| has been read. Allow \_ (underscore) in file names, hence change the
% |\catcode| of it.
%    \begin{macrocode}

%
% Whenever reading another portion of the SVN/RCS info,
% expand \@svnBeginRead before calling the reading macro
% and call \@svnEndRead as first thing inside the reading macro.
\def\@svnBeginRead{\begingroup
   \catcode`\_=13 %
   \catcode`:=12 %
   \catcode`\\=12 %
}
\def\@svnEndRead{\endgroup
}


\def\svnInfo {\@svnBeginRead
  \@svnInfoReadArgs 
 }
%    \end{macrocode}
%\end{macro}

%\begin{macro}{\@svnInfoReadArgs}
% First check, if the \Id\ string is not-expanded.
% Set the default values, so that for not expanded \Id\ strings, we get them.
% The \$ before |Id| may be omitted (I use this to avoid expansion of
% \$Id-Tags to be expanded by SVN in some cases).
% Restore the catcode of the |:|.
%    \begin{macrocode}

\def\@svnInfoReadArgs #1Id#2 {\@svnEndRead
  \@svnInfoDefaults
  \if $#2 \expandafter\@svnInfoEat
  \else   \@svnBeginRead
          \expandafter\@svnInfoEatColon
  \fi
  $Id#2 %
}
%    \end{macrocode}
%\end{macro}

%\begin{macro}{\@svnInfoEat}
% This macro eats up its argument, i.e.\ removes it from the input.
% Reset the |\catcode| of the underscore.
%    \begin{macrocode}
\def\@svnInfoEat #1 {}
%    \end{macrocode}
%\end{macro}

%\begin{macro}{\@svnInfoEatColon}
% This macro eats up the colon following \texttt{Id}.
% The colon may be followed by a \$, which means that the \Id\ string is not
% expanded.
%    \begin{macrocode}
\def\@svnInfoEatColon $Id:#1 {\@svnEndRead
  \if $#1 \expandafter\@svnInfoEat
  \else   \@svnBeginRead
          \expandafter\@svnInfoCrackAndEat
  \fi
  #1 %
}
%    \end{macrocode}
%\end{macro}

%\begin{macro}{\@svnInfoCrackAndEat}
% Take an expanded \Id\ string pass it to the crack routine
% |\@svnInfoCrack|\-|String|, which specifies what has to be done
% after it. We have already eaten the \$.
% Note: here we don't give an argument to |\@svnInfoNext|, since it is taken
% form the source, in case of |\@svnInfoEat|.
% We have to take the next 7 tokens.
% Note, first argument (\verb|#1|) contains only spaces. 
%    \begin{macrocode}
\def\@svnInfoCrackAndEat #1 #2 #3 #4 #5 #6 {\@svnEndRead
  \@svnInfoCrackString #2 #3 #4 #5 #6 %
}
%    \end{macrocode}
%\end{macro}

%\begin{macro}{\@svnInfoCrackString}
% Take an expanded \Id\ string and crack it:\\
% \#1: filename, \#2 revision, \#3 date, \#4 time, \#5 owner\\
% Hence we have to consume the terminating \$ afterwards. Reset 
% the |\catcode| of the underscore.
%
% If the document checked into the repository without authentication, 
% the owner may be empty. In that case the argument \#5 is \$ and 
% we already consumed the terminating \$.
%
% Split the date into year,month and day.
% If the option \texttt{today} is given, |\svnToday| returns from now
% on the \Svn\ date.
%
%    \begin{macrocode}
\def\@svnInfoCrackString #1 #2 #3 #4 #5 {%
  \def\svnInfoFile{#1}%
  \def\svnInfoRevision{#2}%
  \ifthenelse{\(\equal{\svnInfoMaxRevision}{--maxrevision--}\) %
    \OR \( #2 > \svnInfoMaxRevision \)}{%
    \@svnInfoMaxYear  =\@svnInfoYear
    \@svnInfoMaxMonth =\@svnInfoMonth
    \@svnInfoMaxDay   =\@svnInfoDay
    \def\svnInfoMaxRevision{#2}%
  }{}%
  \ifthenelse{\(\equal{\svnInfoMinRevision}{--minrevision--}\) %
    \OR \( #2 < \svnInfoMinRevision \)}{\def\svnInfoMinRevision{#2}}{}%
  \def\svnInfoTime{#4}%
%
  \@svnInfoSplitDate x#3x%
  \@svnInfoMargin%
  \def\svnInfoLongDate{\@svnInfoToday}%
  \if@svnInfoToday@
    \year  =\@svnInfoYear
    \month =\@svnInfoMonth
    \day   =\@svnInfoDay
  \fi
  \if $#5 \def\svnInfoOwner{}%$%
          \def\svnId{#1\ #2\ #3\ #4}%
  \else 
    \def\svnInfoOwner{#5}%
    \def\svnId{#1\ #2\ #3\ #4\ #5}%
    \expandafter\@svnInfoEat
  \fi
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@svnInfoSplitDate}
% This macro sets |\svnInfoYear|, |\svnInfoMonth|, and |\svnInfoDay|.
% It takes a \texttt{x}\emph{YYYY-MM-DD}\texttt{x} style of argument.
%    \begin{macrocode}
\if@svnInfoSVK@
  \def\@svnInfoSplitDate x#1-#2-#3T#4Zx{%
    \@svnInfoDay  =#3\relax
    \@svnInfoMonth=#2\relax
    \@svnInfoYear =#1\relax
}
\else%
  \def\@svnInfoSplitDate x#1-#2-#3x{%
    \@svnInfoDay  =#3\relax
    \@svnInfoMonth=#2\relax
    \@svnInfoYear =#1\relax
}
\fi%
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@svnInfoToday}
% Returns the \Svn\ date in the form as |\today| does it.
% To do this, we set |\year|, |\month| and |\day| commands to the
% corresponding \Svn\ information, let |\svnToday| does its work, i.e.\
% transforming the date into a language dependent string and reset
% |\year|, |\month| and |\day| to their previous value.
%
%    \begin{macrocode}
\def\@svnInfoToday {%
 \begingroup
   \year  =\@svnInfoYear
   \month =\@svnInfoMonth
   \day   =\@svnInfoDay
   \svnToday
 \endgroup
}
\def\@svnInfoMaxToday {%
 \begingroup
   \year  =\@svnInfoMaxYear
   \month =\@svnInfoMaxMonth
   \day   =\@svnInfoMaxDay
   \svnToday
 \endgroup
}

%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@svnInfoDefaults}
% This macro sets the default values.
%    \begin{macrocode}
\def\@svnInfoDefaults {%
  \@svnInfoYear  =\year
  \@svnInfoMonth =\month
  \@svnInfoDay   =\day
  \@svnInfoMaxYear  =\year
  \@svnInfoMaxMonth =\month
  \@svnInfoMaxDay   =\day
  \def\svnInfoFile{--sourcefile--}%
  \def\svnInfoHeadURL{--head-url--}%
  \def\svnInfoDate{\the\@svnInfoYear-\two@digits\@svnInfoMonth-%
                   \two@digits\@svnInfoDay}%
  \def\svnInfoTime{--time--}%
  \def\svnInfoRevision{--revision--}%
  \ifthenelse{\isundefined{\svnInfoMinRevision}}{\def\svnInfoMinRevision{--minrevision--}}{}%
  \ifthenelse{\isundefined{\svnInfoMaxRevision}}{\def\svnInfoMaxRevision{--maxrevision--}}{}%
  \def\svnInfoOwner{--owner--}%
  \def\svnInfoYear{\the\@svnInfoYear}%
  \def\svnInfoMonth{\the\@svnInfoMonth}%
  \def\svnInfoDay{\the\@svnInfoDay}%
  \def\svnInfoLongDate{\@svnInfoToday}%
  \ifthenelse{\isundefined{\svnInoMaxToday}}{\def\svnMaxToday{\@svnInfoMaxToday}}{}%
  \def\svnId{\svnInfoFile\ \svnInfoRevision\ \svnInfoTime\ \svnInfoOwner}%
}

%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@svnInfoFancyFoot}
% This defines the contents of the footline
%    \begin{macrocode}
\def\@svnInfoFancyFoot {%
    \if@svnInfoRevRange@
      \def\@svnInfoRevisionRange{{ (\svnInfoMinRevision : \svnInfoMaxRevision)}}%
    \else
      \def\@svnInfoRevisionRange{\relax}%
    \fi
  \if@svnInfoLong@
    \def\@svnInfoFancyInfo{{\footnotesize
                           \emph{Rev: \svnInfoRevision\@svnInfoRevisionRange, %
			              \svnInfoLongDate}}}%
  \else
    \def\@svnInfoFancyInfo{{\footnotesize
          \emph{Rev: \svnInfoRevision\@svnInfoRevisionRange, %
				     \svnInfoDate}}}%
  \fi
  \def\@svnInfoFancyFile{{\footnotesize\emph{\svnInfoFile}}}%
%    \end{macrocode}
% and set it for the \texttt{fancyheadings} package,
% package page style.
%    \begin{macrocode}
  \if@svnInfoDraft@
  \if@svnInfoUseFancy@
    \rfoot[\fancyplain{\@svnInfoFancyFile}{\@svnInfoFancyFile}]%
          {\fancyplain{\@svnInfoFancyInfo}{\@svnInfoFancyInfo}}%
    \lfoot[\fancyplain{\@svnInfoFancyInfo}{\@svnInfoFancyInfo}]%
          {\fancyplain{\@svnInfoFancyFile}{\@svnInfoFancyFile}}%
    \setlength{\footrulewidth}{0.4pt}%
    \setlength{\plainfootrulewidth}{0.4pt}%
  \fi
  \fi
%    \end{macrocode}
% for the \texttt{fancyhdr} package,
%    \begin{macrocode}
  \if@svnInfoDraft@
  \if@svnInfoUseFancyhdr@
    \if@twoside
      \fancyfoot[LE,RO]{\@svnInfoFancyInfo}%
      \fancyfoot[LO,RE]{\@svnInfoFancyFile}%
      \fancyfoot[CO,CE]{\thepage}%
      \renewcommand{\footrulewidth}{0.4pt}%
      \fancypagestyle{plain}{%
         \fancyfoot[LE,RO]{\@svnInfoFancyInfo}%
         \fancyfoot[LO,RE]{\@svnInfoFancyFile}%
         \fancyfoot[CO,CE]{\thepage}%
         \renewcommand{\footrulewidth}{0.4pt}%
       }
    \else
      \fancyfoot[L]{\@svnInfoFancyInfo}%
      \fancyfoot[R]{\@svnInfoFancyFile}%
      \fancyfoot[C]{\thepage}%
      \renewcommand{\footrulewidth}{0.4pt}%
      \fancypagestyle{plain}{%
         \fancyfoot[L]{\@svnInfoFancyInfo}%
         \fancyfoot[R]{\@svnInfoFancyFile}%
         \fancyfoot[C]{\thepage}%
         \renewcommand{\footrulewidth}{0.4pt}%
       }
    \fi   
  \fi
  \fi
%    \end{macrocode}
% for the \texttt{srcpage2} package,
%    \begin{macrocode}
 \if@svnInfoDraft@ 
\if@svnInfoUseScrpage@
    \clearscrheadfoot%
    \ohead{\headmark}%
    \cfoot[\emph{\@svnInfoFancyInfo}]{\emph{\@svnInfoFancyInfo}}%
    \ifoot[\@svnInfoFancyFile]{\@svnInfoFancyFile}%
    \ofoot[\pagemark]{\pagemark}%
    \pagestyle{scrheadings}%
  \fi
\fi
%    \end{macrocode}
% for the \texttt{eso-pic} package,
%    \begin{macrocode}
 \if@svnInfoDraft@
 \if@svnInfoUseEsofoot@
   \AddToShipoutPicture{%
    \setlength{\unitlength}{1mm}%
    \put(5,5){\tiny\svnInfoFile\quad\svnInfoRevision\quad\svnInfoDate%
    \quad\svnInfoTime\quad\svnInfoOwner}%
 }
\fi
\fi
}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\@svnInfoMargin}
% for the \texttt{margin} option.
%    \begin{macrocode}
\def\@svnInfoMargin{
 \if@svnInfoDraft@
 \if@svnInfoNotPreamble@
 \if@svnInfoUseMargin@
 \expandafter\marginpar[%
 {\raggedleft\tiny\svnInfoFile, \svnInfoRevision, %
   \svnInfoDate, \svnInfoTime, \svnInfoOwner}%
 ]{%
 {\raggedright\tiny\svnInfoFile, \svnInfoRevision, %
   \svnInfoDate, \svnInfoTime, \svnInfoOwner}%
 }%
\fi
\fi
\fi
}
%    \end{macrocode}
%
% \end{macro}
%
% Initialize the defaults
%    \begin{macrocode}
\@svnInfoDefaults
%    \end{macrocode}

% At the start of the document, if we use the
% \texttt{fancyhdr} footline, we should set it here.
%    \begin{macrocode}
\AtBeginDocument{%
 \@svnInfoNotPreamble@true 
 \if@svnInfoDraft@
  \if@svnInfoUseFancy@
    \@svnInfoFancyFoot
  \fi
  \if@svnInfoUseFancyhdr@
    \@svnInfoFancyFoot
  \fi
  \if@svnInfoUseScrpage@
    \@svnInfoFancyFoot
  \fi
  \if@svnInfoUseEsofoot@
    \@svnInfoFancyFoot
  \fi
\fi
}
%    \end{macrocode}
% At the end of the document
%    \begin{macrocode}
\AtEndDocument{%
  \immediate\write\@mainaux{\string\gdef\string\svnInfoMinRevision{\svnInfoMinRevision}}% 
  \immediate\write\@mainaux{\string\gdef\string\svnInfoMaxRevision{\svnInfoMaxRevision}}% 
  \immediate\write\@mainaux{\string\gdef\string\svnMaxToday{\immediate\svnMaxToday}}% 
}
%    \end{macrocode}
%\subsection{The generic \texttt{\string\svnKeyword} command}
% \begin{macro}{\svnKeyword}
%   |\svnKeyword| is the main construct. The single argument
%   should be of the form |$|\meta{Keyword}|$| or
%   |$|\meta{Keyword}:\meta{space}\meta{value}\meta{space}|$|, where
%   \meta{Keyword} and \meta{value} must be non-empty as well as
%   brace- and |\if|--|\fi|- balanced. \meta{space} is a single space
%   (if more are present they will be subsumed into \meta{value}).  If
%   `|$empty$|', `|$generic$|', |$Time$| or ever become keywords, or
%   if keywords containing |@| ever exist then we may have problems.
%    \begin{macrocode}               
\def\svnKeyword $#1${\svn@$#1: $}                       
%    \end{macrocode}                                           
% \end{macro}                                                
%                                                            
% \begin{macro}{\svnKeywordempty}                                              
%   If \meta{Keyword} is unexpanded then |\svnKeywordKeyword| is
%   set to the macro |\svnKeywordempty|, which is initially empty.
%    \begin{macrocode}                              
\let\svnKeywordempty\relax
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\svn@}
%  \begin{macro}{\svn@tmp}
%    |\svn@| does the work for |\svnKeyword|.  It takes two
%    arguments, the first is the \meta{Keyword}'s name, the second is
%    empty (in which case \meta{Keyword} was unexpanded) or
%    \meta{value}, the expansion of \meta{keyword}.
%    \begin{macrocode}
\def\svn@$#1: #2${%
  \def\svn@tmp{#2}%
%    \end{macrocode}
%   \begin{macro}{\svn@suffix}
%     If \param2 is empty, then the keyword was unexpanded and
%     |\svn@suffix| is set to |@unexp|, otherwise we had an
%     expanded keyword so |\svn@suffix| is set to |@exp|.
%    \begin{macrocode}
  \ifx\svn@tmp\@empty
    \def\svn@suffix{@unexp}%
  \else
    \def\svn@suffix{@exp}%
  \fi
%    \end{macrocode}
% If |\svnKeyword@|\param1\meta{suffix} is defined then run it
% with arguments `\param1\param2', else run
% |\svnKeyword@generic@|\meta{suffix} (again with argument
% \param1\param2---by default this defines `|\svnKeyword|\meta{\param1}' to
% be \param2, or |\svnKeywordempty| in the unexpanded case).
%    \begin{macrocode}
  \@ifundefined{svnKeyword@#1\svn@suffix}%
      {\@nameuse{svnKeyword@generic\svn@suffix}{#1}{#2}}%
    {\@nameuse{svnKeyword@#1\svn@suffix}{#1}{#2}}%
}
%    \end{macrocode}
%   \end{macro}
%  \end{macro}
% \end{macro}
% \subsubsection{Dealing with general \texttt{\string$Keyword\string$}s}
% \begin{macro}{\svnKeyword@generic@exp}
%   When we see |\svnKeyword $KeyWord: <stuff> $|, and
%   |\svnKeyword@KeyWord@exp| is undefined, then we define the macro
%   |\svnKeywordKeyWord| to be |<stuff>| using
%   |\svnKeyword@generic@exp{KeyWord}{<stuff>}|.
%    \begin{macrocode}
\def\svnKeyword@generic@exp#1#2{%
  \expandafter\svn@set\csname svnKeyword#1\endcsname$#2$%
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\svnKeyword@generic@unexp}
%   When we see |\svnKeyword $KeyWord$| and 
%   |\svnKeyword@KeyWord@unexp| is undefined, we define
%   |\svnKeywordKeyWord| to be |\svnKeywordempty| using
%   |\svnKeyword@generic@unexp{KeyWord}|.
%    \begin{macrocode}
\def\svnKeyword@generic@unexp#1#2{%
  \expandafter\global\expandafter\let\csname svnKeyword#1\endcsname\svnKeywordempty
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\svn@set}
% |\svn@set#1$#2$| defines the command in \param{1} to be \param{2}
% without the trailing `\verb*| : |' that the call to |\svn@| added.
%    \begin{macrocode}
\def\svn@set#1$#2 : ${\gdef#1{#2}}
%    \end{macrocode}
% \end{macro}
%
% \subsubsection{Dealing with the \texttt{\string$Date\string$} keyword}
% \begin{macro}{\svnKeyword@Date@unexp}
%  \begin{macro}{\svnKeyword@LastChangedDate@unexp}
%    \begin{macrocode}
\def\svnKeyword@Date@unexp#1#2{}%
\let\svnKeyword@LastChangedDate@unexp\svnKeyword@Date@unexp%
%    \end{macrocode}
%  \end{macro}
% \end{macro}
%
% \begin{macro}{\svnKeyword@Date@exp}
% \begin{macro}{\svnKeyword@LastChangedDate@exp}
%    \begin{macrocode}
\def\svnKeyword@Date@exp#1#2{%
  \svn@parse@date$#2$%
}%
\let\svnKeyword@LastChangedDate@exp\svnKeyword@Date@exp
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \begin{macro}{\svn@parse@date}
%    \begin{macrocode}
\if@svnInfoSVK@
  \def\svn@parse@date$#1-#2-#3T#4:#5:#6.#7${%
    \@svnInfoDay  =#3\relax%
    \@svnInfoMonth=#2\relax%
    \@svnInfoYear =#1\relax%
    \def\svnInfoLongDate{\@svnInfoToday}%
    \if@svnInfoToday@
      \year  =\@svnInfoYear
      \month =\@svnInfoMonth
      \day   =\@svnInfoDay
    \fi
%    \end{macrocode}
% We could add `GMT' to |\svnKeywordTime|. Or not bother.
%    \begin{macrocode}
     \def\svnInfoTime{#4:#5:#6}%
   }
\else
\def\svn@parse@date$#1-#2-#3 #4:#5:#6 #7${%

  \@svnInfoDay  =#3\relax%
  \@svnInfoMonth=#2\relax%
  \@svnInfoYear =#1\relax%
    \def\svnInfoLongDate{\@svnInfoToday}%
    \if@svnInfoToday@
      \year  =\@svnInfoYear
      \month =\@svnInfoMonth
      \day   =\@svnInfoDay
    \fi
     \def\svnInfoTime{#4:#5:#6}%
  }
\fi   
%    \end{macrocode}
% \end{macro}

% \subsubsection{Dealing with the \texttt{\string$Id\string$} keyword}
% \begin{macro}{\svnKeyword@Id@unexp}
%    \begin{macrocode}
\def\svnKeyword@Id@unexp#1#2{}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\svnKeyword@Id@exp}
%    \begin{macrocode}
\def\svnKeyword@Id@exp#1#2{% 
  \svn@parse@id$#2$
}%
\def\svn@parse@id$#1 : ${%
  \svnInfo $Id: #1 $ %
}%
%    \end{macrocode}
% \end{macro}

% \subsubsection{Dealing with the \texttt{\string$Author\string$} keyword}
% \begin{macro}{\svnKeyword@Author@unexp}
% \begin{macro}{\svnKeyword@LastChangedBy@exp}
%    \begin{macrocode}
\def\svnKeyword@Author@unexp#1#2{}%
\let\svnKeyword@LastChangedBy@unexp\svnKeyword@Author@unexp%
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\svnKeyword@Author@exp}
% \begin{macro}{\svnKeyword@LastChangedBy@exp}
%    \begin{macrocode}
\def\svnKeyword@Author@exp#1#2{% 
  \svn@parse@Author$#2$
}%
\def\svn@parse@Author$#1 : ${%
  \def\svnInfoOwner{#1}%
}%
\let\svnKeyword@LastChangedBy\svnKeyword@Author@exp%
%    \end{macrocode}
% \end{macro}
% \end{macro}

% \subsubsection{Dealing with the \texttt{\string$Revision\string$} keyword}
% \begin{macro}{\svnKeyword@Revision@unexp}
% \begin{macro}{\svnKeyword@LastChangedRevision@unexp}
% \begin{macro}{\svnKeyword@Rev@unexp}
%    \begin{macrocode}
\def\svnKeyword@Revision@unexp#1#2{}%
\let\svnKeyword@LastChangedRevision@unexp\svnKeyword@Revision@unexp%
\let\svnKeyword@Rev@unexp\svnKeyword@Revision@unexp%
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\svnKeyword@Revision@exp}
% \begin{macro}{\svnKeyword@LastChangedRevision@exp}
% \begin{macro}{\svnKeyword@Rev@exp}
%    \begin{macrocode}
\def\svnKeyword@Revision@exp#1#2{% 
  \svn@parse@Revision$#2$%
}%
\def\svn@parse@Revision$#1 : ${%
  \def\svnInfoRevision{#1}%
    \ifthenelse{\(\equal{\svnInfoMaxRevision}{--maxrevision--}\) %
    \OR \(#1 > \svnInfoMaxRevision \)}{\def\svnInfoMaxRevision{#1}}{}%
  \ifthenelse{\(\equal{\svnInfoMinRevision}{--minrevision--}\) %
    \OR \( #1 < \svnInfoMinRevision \)}{\def\svnInfoMinRevision{#1}}{}%
}%
\let\svnKeyword@LastChangedRevision@exp\svnKeyword@Revision@exp%
\let\svnKeyword@Rev@unexp\svnKeyword@Revision@exp%
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}

% \subsubsection{Dealing with the \texttt{\string$HeadURL\string$} keyword}
% \begin{macro}{\svnKeyword@HeadURL@unexp}
%    \begin{macrocode}
\def\svnKeyword@HeadURL@unexp#1#2{}%
\let\svnKeyword@URL@unexp\svnKeyword@HeadURL@unexp%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\svnKeyword@HeadURL@exp}
%    \begin{macrocode}
\def\svnKeyword@HeadURL@exp#1#2{% 
  \svn@parse@HeadURL$#2$%
}%
\def\svn@parse@HeadURL$#1 : ${%
  \def\svnInfoHeadURL{#1}%
}%
\let\svnKeyword@URL@exp\svnKeyword@HeadURL@exp%
%</package>
%    \end{macrocode}
% \end{macro}
%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \centerline{That's the end}
%
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% \Finale
%
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \iffalse
%
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% The following stuff does not show up in the documentation of the package:
% 				svninfo.ins
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%<*ins>
\def\batchfile{svninfo.ins}
\input docstrip.tex

\Msg{}
\Msg{***********************************************************}
\Msg{** Hello to the installation of the `svninfo' package.}
\Msg{** Version 0.7, March 26, 2007}
\Msg{***********************************************************}
\Msg{}

\generate{
        \askforoverwritefalse
%        \file{svninfo.ins}{\from{svninfo.dtx}{header,ins}}
        \file{svninfo.sty}{\from{svninfo.dtx}{header,package}}
        \usepreamble\empty
        \usepostamble\empty
        \file{svninfo.perl}{\from{svninfo.dtx}{perl}}
        \file{svninfo.init}{\from{svninfo.dtx}{init}}
        \file{svninfo.cfg}{\from{svninfo.dtx}{header,config}}
}

\Msg{}
\Msg{***********************************************************}
\Msg{** Edit the file svninfo.cfg and set the default fancy headings package}
\Msg{** To finish the installation move the file `svninfo.sty' and}
\Msg{** svninfo.cfg to a place where LaTeX will find it.}
\Msg{** To Get the documentation: `latex svninfo.dtx'}
\Msg{** Happy TeXing}
\Msg{***********************************************************}
\Msg{}
%</ins>
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                    E N D     of     S V N I N F O . D T X
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\fi