gdiff 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. data/CHANGELOG +7 -0
  2. data/COPYING.suffix_array +278 -0
  3. data/LICENSE.suffix_array +17 -0
  4. data/README +40 -0
  5. data/README.suffix_array +274 -0
  6. data/bin/gdiff +25 -0
  7. data/bin/gpatch +25 -0
  8. data/doc/classes/Diff.html +117 -0
  9. data/doc/classes/Diff/GDiff.html +120 -0
  10. data/doc/classes/Diff/GDiff/EGdiffError.html +111 -0
  11. data/doc/classes/Diff/GDiff/ENoGdiffStream.html +113 -0
  12. data/doc/classes/Diff/GDiff/EPrematureEndOfStream.html +113 -0
  13. data/doc/classes/Diff/GDiff/Operations.html +156 -0
  14. data/doc/classes/Diff/GDiff/Operations/Copy.html +246 -0
  15. data/doc/classes/Diff/GDiff/Operations/Copy.src/M000014.html +19 -0
  16. data/doc/classes/Diff/GDiff/Operations/Copy.src/M000015.html +39 -0
  17. data/doc/classes/Diff/GDiff/Operations/Copy.src/M000016.html +25 -0
  18. data/doc/classes/Diff/GDiff/Operations/Copy.src/M000017.html +18 -0
  19. data/doc/classes/Diff/GDiff/Operations/Data.html +246 -0
  20. data/doc/classes/Diff/GDiff/Operations/Data.src/M000009.html +18 -0
  21. data/doc/classes/Diff/GDiff/Operations/Data.src/M000010.html +18 -0
  22. data/doc/classes/Diff/GDiff/Operations/Data.src/M000011.html +35 -0
  23. data/doc/classes/Diff/GDiff/Operations/Data.src/M000012.html +29 -0
  24. data/doc/classes/Diff/GDiff/Operations/Data.src/M000013.html +19 -0
  25. data/doc/classes/SAError.html +111 -0
  26. data/doc/classes/SuffixArray.html +342 -0
  27. data/doc/classes/SuffixArray.src/M000001.html +97 -0
  28. data/doc/classes/SuffixArray.src/M000002.html +73 -0
  29. data/doc/classes/SuffixArray.src/M000003.html +102 -0
  30. data/doc/classes/SuffixArray.src/M000004.html +47 -0
  31. data/doc/classes/SuffixArray.src/M000005.html +44 -0
  32. data/doc/classes/SuffixArray.src/M000006.html +33 -0
  33. data/doc/classes/SuffixArray.src/M000007.html +24 -0
  34. data/doc/classes/SuffixArray.src/M000008.html +46 -0
  35. data/doc/created.rid +1 -0
  36. data/doc/files/ext/gdiff/suffix_array/extconf_rb.html +108 -0
  37. data/doc/files/ext/gdiff/suffix_array/lcp_c.html +101 -0
  38. data/doc/files/ext/gdiff/suffix_array/sarray_c.html +101 -0
  39. data/doc/files/ext/gdiff/suffix_array/suffix_array_c.html +101 -0
  40. data/doc/files/lib/gdiff_rb.html +108 -0
  41. data/doc/fr_class_index.html +36 -0
  42. data/doc/fr_file_index.html +31 -0
  43. data/doc/fr_method_index.html +43 -0
  44. data/doc/index.html +24 -0
  45. data/doc/rdoc-style.css +208 -0
  46. data/ext/gdiff/COPYING +278 -0
  47. data/ext/gdiff/LICENSE +17 -0
  48. data/ext/gdiff/README +274 -0
  49. data/ext/gdiff/extconf.rb +3 -0
  50. data/ext/gdiff/lcp.c +97 -0
  51. data/ext/gdiff/sarray.3 +145 -0
  52. data/ext/gdiff/sarray.c +372 -0
  53. data/ext/gdiff/sarray.h +13 -0
  54. data/ext/gdiff/suffix_array.c +510 -0
  55. data/lib/gdiff.rb +255 -0
  56. data/setup.rb +1551 -0
  57. data/test/tc_gdiff.rb +66 -0
  58. metadata +119 -0
@@ -0,0 +1,7 @@
1
+ 0.0.1
2
+ * Improved documentation
3
+ * Releasing as a .gem, .tar.gz, .tar.bz2, and .zip.
4
+ * Improved interface
5
+
6
+ 0.0.0
7
+ * Initial Release
@@ -0,0 +1,278 @@
1
+ GNU GENERAL PUBLIC LICENSE
2
+ Version 2, June 1991
3
+
4
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
5
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
6
+ Everyone is permitted to copy and distribute verbatim copies
7
+ of this license document, but changing it is not allowed.
8
+
9
+ Preamble
10
+
11
+ The licenses for most software are designed to take away your
12
+ freedom to share and change it. By contrast, the GNU General Public
13
+ License is intended to guarantee your freedom to share and change free
14
+ software--to make sure the software is free for all its users. This
15
+ General Public License applies to most of the Free Software
16
+ Foundation's software and to any other program whose authors commit to
17
+ using it. (Some other Free Software Foundation software is covered by
18
+ the GNU Library General Public License instead.) You can apply it to
19
+ your programs, too.
20
+
21
+ When we speak of free software, we are referring to freedom, not
22
+ price. Our General Public Licenses are designed to make sure that you
23
+ have the freedom to distribute copies of free software (and charge for
24
+ this service if you wish), that you receive source code or can get it
25
+ if you want it, that you can change the software or use pieces of it
26
+ in new free programs; and that you know you can do these things.
27
+
28
+ To protect your rights, we need to make restrictions that forbid
29
+ anyone to deny you these rights or to ask you to surrender the rights.
30
+ These restrictions translate to certain responsibilities for you if you
31
+ distribute copies of the software, or if you modify it.
32
+
33
+ For example, if you distribute copies of such a program, whether
34
+ gratis or for a fee, you must give the recipients all the rights that
35
+ you have. You must make sure that they, too, receive or can get the
36
+ source code. And you must show them these terms so they know their
37
+ rights.
38
+
39
+ We protect your rights with two steps: (1) copyright the software, and
40
+ (2) offer you this license which gives you legal permission to copy,
41
+ distribute and/or modify the software.
42
+
43
+ Also, for each author's protection and ours, we want to make certain
44
+ that everyone understands that there is no warranty for this free
45
+ software. If the software is modified by someone else and passed on, we
46
+ want its recipients to know that what they have is not the original, so
47
+ that any problems introduced by others will not reflect on the original
48
+ authors' reputations.
49
+
50
+ Finally, any free program is threatened constantly by software
51
+ patents. We wish to avoid the danger that redistributors of a free
52
+ program will individually obtain patent licenses, in effect making the
53
+ program proprietary. To prevent this, we have made it clear that any
54
+ patent must be licensed for everyone's free use or not licensed at all.
55
+
56
+ The precise terms and conditions for copying, distribution and
57
+ modification follow.
58
+
59
+ GNU GENERAL PUBLIC LICENSE
60
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61
+
62
+ 0. This License applies to any program or other work which contains
63
+ a notice placed by the copyright holder saying it may be distributed
64
+ under the terms of this General Public License. The "Program", below,
65
+ refers to any such program or work, and a "work based on the Program"
66
+ means either the Program or any derivative work under copyright law:
67
+ that is to say, a work containing the Program or a portion of it,
68
+ either verbatim or with modifications and/or translated into another
69
+ language. (Hereinafter, translation is included without limitation in
70
+ the term "modification".) Each licensee is addressed as "you".
71
+
72
+ Activities other than copying, distribution and modification are not
73
+ covered by this License; they are outside its scope. The act of
74
+ running the Program is not restricted, and the output from the Program
75
+ is covered only if its contents constitute a work based on the
76
+ Program (independent of having been made by running the Program).
77
+ Whether that is true depends on what the Program does.
78
+
79
+ 1. You may copy and distribute verbatim copies of the Program's
80
+ source code as you receive it, in any medium, provided that you
81
+ conspicuously and appropriately publish on each copy an appropriate
82
+ copyright notice and disclaimer of warranty; keep intact all the
83
+ notices that refer to this License and to the absence of any warranty;
84
+ and give any other recipients of the Program a copy of this License
85
+ along with the Program.
86
+
87
+ You may charge a fee for the physical act of transferring a copy, and
88
+ you may at your option offer warranty protection in exchange for a fee.
89
+
90
+ 2. You may modify your copy or copies of the Program or any portion
91
+ of it, thus forming a work based on the Program, and copy and
92
+ distribute such modifications or work under the terms of Section 1
93
+ above, provided that you also meet all of these conditions:
94
+
95
+ a) You must cause the modified files to carry prominent notices
96
+ stating that you changed the files and the date of any change.
97
+
98
+ b) You must cause any work that you distribute or publish, that in
99
+ whole or in part contains or is derived from the Program or any
100
+ part thereof, to be licensed as a whole at no charge to all third
101
+ parties under the terms of this License.
102
+
103
+ c) If the modified program normally reads commands interactively
104
+ when run, you must cause it, when started running for such
105
+ interactive use in the most ordinary way, to print or display an
106
+ announcement including an appropriate copyright notice and a
107
+ notice that there is no warranty (or else, saying that you provide
108
+ a warranty) and that users may redistribute the program under
109
+ these conditions, and telling the user how to view a copy of this
110
+ License. (Exception: if the Program itself is interactive but
111
+ does not normally print such an announcement, your work based on
112
+ the Program is not required to print an announcement.)
113
+
114
+ These requirements apply to the modified work as a whole. If
115
+ identifiable sections of that work are not derived from the Program,
116
+ and can be reasonably considered independent and separate works in
117
+ themselves, then this License, and its terms, do not apply to those
118
+ sections when you distribute them as separate works. But when you
119
+ distribute the same sections as part of a whole which is a work based
120
+ on the Program, the distribution of the whole must be on the terms of
121
+ this License, whose permissions for other licensees extend to the
122
+ entire whole, and thus to each and every part regardless of who wrote it.
123
+
124
+ Thus, it is not the intent of this section to claim rights or contest
125
+ your rights to work written entirely by you; rather, the intent is to
126
+ exercise the right to control the distribution of derivative or
127
+ collective works based on the Program.
128
+
129
+ In addition, mere aggregation of another work not based on the Program
130
+ with the Program (or with a work based on the Program) on a volume of
131
+ a storage or distribution medium does not bring the other work under
132
+ the scope of this License.
133
+
134
+ 3. You may copy and distribute the Program (or a work based on it,
135
+ under Section 2) in object code or executable form under the terms of
136
+ Sections 1 and 2 above provided that you also do one of the following:
137
+
138
+ a) Accompany it with the complete corresponding machine-readable
139
+ source code, which must be distributed under the terms of Sections
140
+ 1 and 2 above on a medium customarily used for software interchange; or,
141
+
142
+ b) Accompany it with a written offer, valid for at least three
143
+ years, to give any third party, for a charge no more than your
144
+ cost of physically performing source distribution, a complete
145
+ machine-readable copy of the corresponding source code, to be
146
+ distributed under the terms of Sections 1 and 2 above on a medium
147
+ customarily used for software interchange; or,
148
+
149
+ c) Accompany it with the information you received as to the offer
150
+ to distribute corresponding source code. (This alternative is
151
+ allowed only for noncommercial distribution and only if you
152
+ received the program in object code or executable form with such
153
+ an offer, in accord with Subsection b above.)
154
+
155
+ The source code for a work means the preferred form of the work for
156
+ making modifications to it. For an executable work, complete source
157
+ code means all the source code for all modules it contains, plus any
158
+ associated interface definition files, plus the scripts used to
159
+ control compilation and installation of the executable. However, as a
160
+ special exception, the source code distributed need not include
161
+ anything that is normally distributed (in either source or binary
162
+ form) with the major components (compiler, kernel, and so on) of the
163
+ operating system on which the executable runs, unless that component
164
+ itself accompanies the executable.
165
+
166
+ If distribution of executable or object code is made by offering
167
+ access to copy from a designated place, then offering equivalent
168
+ access to copy the source code from the same place counts as
169
+ distribution of the source code, even though third parties are not
170
+ compelled to copy the source along with the object code.
171
+
172
+ 4. You may not copy, modify, sublicense, or distribute the Program
173
+ except as expressly provided under this License. Any attempt
174
+ otherwise to copy, modify, sublicense or distribute the Program is
175
+ void, and will automatically terminate your rights under this License.
176
+ However, parties who have received copies, or rights, from you under
177
+ this License will not have their licenses terminated so long as such
178
+ parties remain in full compliance.
179
+
180
+ 5. You are not required to accept this License, since you have not
181
+ signed it. However, nothing else grants you permission to modify or
182
+ distribute the Program or its derivative works. These actions are
183
+ prohibited by law if you do not accept this License. Therefore, by
184
+ modifying or distributing the Program (or any work based on the
185
+ Program), you indicate your acceptance of this License to do so, and
186
+ all its terms and conditions for copying, distributing or modifying
187
+ the Program or works based on it.
188
+
189
+ 6. Each time you redistribute the Program (or any work based on the
190
+ Program), the recipient automatically receives a license from the
191
+ original licensor to copy, distribute or modify the Program subject to
192
+ these terms and conditions. You may not impose any further
193
+ restrictions on the recipients' exercise of the rights granted herein.
194
+ You are not responsible for enforcing compliance by third parties to
195
+ this License.
196
+
197
+ 7. If, as a consequence of a court judgment or allegation of patent
198
+ infringement or for any other reason (not limited to patent issues),
199
+ conditions are imposed on you (whether by court order, agreement or
200
+ otherwise) that contradict the conditions of this License, they do not
201
+ excuse you from the conditions of this License. If you cannot
202
+ distribute so as to satisfy simultaneously your obligations under this
203
+ License and any other pertinent obligations, then as a consequence you
204
+ may not distribute the Program at all. For example, if a patent
205
+ license would not permit royalty-free redistribution of the Program by
206
+ all those who receive copies directly or indirectly through you, then
207
+ the only way you could satisfy both it and this License would be to
208
+ refrain entirely from distribution of the Program.
209
+
210
+ If any portion of this section is held invalid or unenforceable under
211
+ any particular circumstance, the balance of the section is intended to
212
+ apply and the section as a whole is intended to apply in other
213
+ circumstances.
214
+
215
+ It is not the purpose of this section to induce you to infringe any
216
+ patents or other property right claims or to contest validity of any
217
+ such claims; this section has the sole purpose of protecting the
218
+ integrity of the free software distribution system, which is
219
+ implemented by public license practices. Many people have made
220
+ generous contributions to the wide range of software distributed
221
+ through that system in reliance on consistent application of that
222
+ system; it is up to the author/donor to decide if he or she is willing
223
+ to distribute software through any other system and a licensee cannot
224
+ impose that choice.
225
+
226
+ This section is intended to make thoroughly clear what is believed to
227
+ be a consequence of the rest of this License.
228
+
229
+ 8. If the distribution and/or use of the Program is restricted in
230
+ certain countries either by patents or by copyrighted interfaces, the
231
+ original copyright holder who places the Program under this License
232
+ may add an explicit geographical distribution limitation excluding
233
+ those countries, so that distribution is permitted only in or among
234
+ countries not thus excluded. In such case, this License incorporates
235
+ the limitation as if written in the body of this License.
236
+
237
+ 9. The Free Software Foundation may publish revised and/or new versions
238
+ of the General Public License from time to time. Such new versions will
239
+ be similar in spirit to the present version, but may differ in detail to
240
+ address new problems or concerns.
241
+
242
+ Each version is given a distinguishing version number. If the Program
243
+ specifies a version number of this License which applies to it and "any
244
+ later version", you have the option of following the terms and conditions
245
+ either of that version or of any later version published by the Free
246
+ Software Foundation. If the Program does not specify a version number of
247
+ this License, you may choose any version ever published by the Free Software
248
+ Foundation.
249
+
250
+ 10. If you wish to incorporate parts of the Program into other free
251
+ programs whose distribution conditions are different, write to the author
252
+ to ask for permission. For software which is copyrighted by the Free
253
+ Software Foundation, write to the Free Software Foundation; we sometimes
254
+ make exceptions for this. Our decision will be guided by the two goals
255
+ of preserving the free status of all derivatives of our free software and
256
+ of promoting the sharing and reuse of software generally.
257
+
258
+ NO WARRANTY
259
+
260
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261
+ FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
262
+ OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263
+ PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264
+ OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265
+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
266
+ TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
267
+ PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268
+ REPAIR OR CORRECTION.
269
+
270
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271
+ WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272
+ REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273
+ INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274
+ OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275
+ TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276
+ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277
+ PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278
+ POSSIBILITY OF SUCH DAMAGES.
@@ -0,0 +1,17 @@
1
+ FastCST -- A tool for revision control.
2
+
3
+ Copyright (C) 2004-2005 Zed A. Shaw
4
+
5
+ This program is free software; you can redistribute it and/or modify
6
+ it under the terms of the GNU General Public License as published by
7
+ the Free Software Foundation; either version 2 of the License, or
8
+ (at your option) any later version.
9
+
10
+ This program is distributed in the hope that it will be useful,
11
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ GNU General Public License for more details.
14
+
15
+ You should have received a copy of the GNU General Public License
16
+ along with this program; if not, write to the Free Software
17
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
data/README ADDED
@@ -0,0 +1,40 @@
1
+ # gdiff / gpatch
2
+
3
+ ## Description
4
+ An implementation of the gdiff protocol.
5
+ [Protocol description](http://www.w3.org/TR/NOTE-gdiff-19970901)
6
+
7
+ ## Find it at
8
+
9
+ http://ruby.brian-schroeder.de/gdiff/
10
+
11
+ ## Installation:
12
+
13
+ wget http://ruby.brian-schroeder.de/gdiff/releases/gdiff-0.0.1.tar.bz2
14
+ tar -xvvjf gdiff-0.0.1.tar.bz2
15
+ cd gdiff-0.0.1
16
+ ruby setup.rb
17
+
18
+ ## Usage:
19
+
20
+ gdiff file_a file_b > patch
21
+ gpatch file_a patch > file_b_from_patch
22
+
23
+ ### or as a library:
24
+
25
+ require 'gdiff'
26
+
27
+ File.open("patch", "wb") do | patch |
28
+ patch << Diff::GDiff.diff(File.read("file_a"), File.read("file_b")).pack
29
+ end
30
+
31
+ File.open("file_b_from_patch", "wb") do | file_b_2 |
32
+ file_b_2 << Diff::GDiff.unpack(File.read("patch")).apply_to(File.read("file_a"))
33
+ end
34
+
35
+ ## Authors
36
+ This was implemented by Brian Schroeder with the help of Zed Shaws wonderfull
37
+ suffix-tree extension.
38
+
39
+ ## License
40
+ GPL and ruby license if applicable (I have to ask zed).
@@ -0,0 +1,274 @@
1
+ == Fast Change Set Tool
2
+
3
+ FastCST is a change set tool I created to experiment with
4
+ ideas in change management, distributed development, and alternatives to existing
5
+ tools.
6
+
7
+ == Current Features
8
+
9
+ FastCST is an evolving tool that you probably shouldn't use quite yet for
10
+ anything serious. It does support a wide range of features, but since I
11
+ started in in March 2005 it's not fully tested yet.
12
+
13
+ The current laundry list of features are:
14
+
15
+ * Complete changesets that are very simple by design and encode complete
16
+ cohesive changes.
17
+ * Extensible meta-data for changesets.
18
+ * A simple to use repository that should be easy for any other languages to read.
19
+ * All revisions are uniquely identified by a UUID to avoid clashing.
20
+ * Ability to undo any applied revision.
21
+ * You can publish your repository to an FTP site efficiently.
22
+ * Directly share your repository for quick small-scale sharing without FTP.
23
+ * Anyone can download the latest revisions from an FTP or HTTP site.
24
+ * Send/receive changesets through e-mail including human readable meta-data.
25
+ * Transaction oriented operation.
26
+ * Remarkably fast operation considering there's been no optimization done and it's written in Ruby.
27
+ * A reasonable shell prompt so you don't have to type 'fcst' in front of everything.
28
+ * A working plugins feature letting you implement your own commands, with an example
29
+ command that creates release archives.
30
+ * A working "triggers" feature so you can easily wrap commands with your own logic.
31
+ * Ability to attach external files to distribute with your changesets (not tested much).
32
+ * Disposition references so you can reference bug trackers, web sites, mailing list posts, etc.
33
+ * 95% pure Ruby.
34
+ * A unique delta algorithm that uses suffix arrays and produces smaller deltas than most other
35
+ delta algorithms without sacrificing speed much.
36
+ * A painstakingly consistent command interface with extensive help for each option.
37
+ * The beginning of a merge feature that let's you merge without needing to reference history.
38
+ * An "index" command that will use suffix arrays to index your files and let you find where
39
+ text is mentioned. This will turn into an optimization and an advanced search feature.
40
+ * Simple and consistent aborting and undo so you can trash your source in the comfort of your
41
+ own stupidity and still recover.
42
+ * Completely redesigned YAML format that avoids using !ruby object loading and uses only
43
+ native types found in all languages. This avoids some security concerns, but YAML needs
44
+ a means of telling it to NOT load arbitrary objects. Still searching, but I may have to
45
+ dump YAML if I can't fix it.
46
+ * Makes a reasonable attempt to deal with symlinks and directories. It treats directories
47
+ as out of band data and simply fixes them up at the end of the application process. This
48
+ is very handy since you can just glance at the meta-data to find out if someone is deleting
49
+ your favorite source tree.
50
+
51
+
52
+ == Missing Features
53
+
54
+ There's still quite a lot of stuff missing that I want to put into FastCST, but these are
55
+ the big ones that it needs before it's useful:
56
+
57
+ * Merging is implemented, but conflict resolution is not yet. It currently will not let
58
+ you resolve conflicts and refuses to do the merge.
59
+ * Recovering individual files from the repository. This is needed to get conflicts working.
60
+ * Better security protections like not using YAML for the journal file or somehow restricting
61
+ what objects can be loaded (that thing is like giving a toddler a shot-gun).
62
+ * Digitally signed and verified revisions so people can confirm who sent the revision.
63
+ * Improved safety checks. It's pretty good now, but things like applying a delta is still
64
+ not as safe as I'd like.
65
+
66
+ Some of the things I'd like to implement are:
67
+
68
+ * Connecting with FAM or Dazuko to let FastCST track your actions and warn about bad stuff.
69
+ * Flexible command aliasing that lets you create alternative commands.
70
+ * Using mDNS to let people quickly and painlessly find repositories and other developers.
71
+ * Hooking into DamageControl and the RSCM library.
72
+
73
+ If you have any suggestions for these or for other features you want then go ahead and
74
+ contact me at zedshaw AT zedshaw DOT com.
75
+
76
+ == Security Warnings
77
+
78
+ DO NOT ACCEPT CHANGESETS FROM PEOPLE YOU DO NOT KNOW. Since there's no digital signature
79
+ capabilities this means nobody except yourself. The reason why is because there are many
80
+ places whe YAML is used, but YAML doesn't provide a mechanism for restricting what can
81
+ be loaded when unmarshalling Ruby structures. It would be no problem for someone to create
82
+ a meta-data or journal file with a bit of code to destroy your world.
83
+
84
+ Another really big caution is please don't use this thing on any source you feel is really
85
+ important. It is still mostly ALPHA stage so there's a very good chance that you'll destroy
86
+ your world if you use it. Especially important is that the delta algorithm is fairly new
87
+ and the suffix array library needs to be audited more.
88
+
89
+ Finally, it uses POP3 and FTP with bare passwords. This is mostly because I'm not sure how
90
+ to get the Net::POP and Net::FTP stuff to use APOP and/or SSL. For the most part I'm just
91
+ tunneling the protocols through SSH to my servers.
92
+
93
+
94
+ == License
95
+
96
+ Copyright (C) 2004-2005 Zed A. Shaw
97
+
98
+ This program is free software; you can redistribute it and/or modify
99
+ it under the terms of the GNU General Public License as published by
100
+ the Free Software Foundation; either version 2 of the License, or
101
+ (at your option) any later version.
102
+
103
+ This program is distributed in the hope that it will be useful,
104
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
105
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
106
+ GNU General Public License for more details.
107
+
108
+ You should have received a copy of the GNU General Public License
109
+ along with this program; if not, write to the Free Software
110
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
111
+
112
+
113
+ === Building
114
+
115
+ The script that does everything is called "fcst", and the Rakefile is setup to build
116
+ a completely stand-alone version. This is the version that you can run with only a
117
+ basic ruby 1.8 install rather than installing all the files in your Ruby directories.
118
+
119
+ Building the fcst script this way requires simply typing "rake" in the source
120
+ directory. When the build is done you'll have a single ruby script in build/fcst.
121
+
122
+
123
+ ==== Debian Notes
124
+
125
+ The build has been tested on ArchLinux and Debian, but to get it to build or
126
+ work under Debian you'll need to do some magic apt-get work:
127
+
128
+ 1. Remove anything remotely related to ruby. The package layout changed recently
129
+ so this is necessary to get it to reinstall correctly.
130
+ 2. apt-get install ruby (not ruby1.8). If you're on the right version of Debian
131
+ (of the 100) you should get the 1.8 stuff with all the goodies.
132
+ 3. Finally make sure you have these packages as well:
133
+ * rake
134
+ * ruby1.8-dev (yes, specify the 1.8 this time)
135
+ * libtest-unit-ruby (no 1.8 this time)
136
+
137
+ Once you do this you can then use the "rake" command to build everything and get
138
+ your stand-alone build/fcst script.
139
+
140
+
141
+ === Installing
142
+
143
+ You can also "install" the fcst script in the normal ruby way using the setup.rb
144
+ script. This installs the required libraries in your Ruby installation's directories
145
+ and thus requires root access.
146
+
147
+ The first thing you need to do is go into the software directory and install the
148
+ PluginFactory, ruby-guid, and rubymail tar.gz sources you find. Each project has
149
+ its own install method, but most use the standard setup.rb or similar. Read their
150
+ instructions.
151
+
152
+ Then installing is done with "ruby setup.rb" in the FastCST source directory. This
153
+ will install the fcst script in your standard bin directory and the required library
154
+ files in your standard Ruby setup. You'll probably need root access for this.
155
+
156
+
157
+ == Getting Started
158
+
159
+ FastCST is designed to be easy to use without restricting your ability to
160
+ get stuff done. This means that most commands are very simple and follow
161
+ a consistent pattern of operation with extensive help. It also means that,
162
+ if you don't like a command or need an additional feature then you can easily
163
+ write your own.
164
+
165
+ The fcst script has two modes of operation:
166
+
167
+ * shell mode -- This lets you run commands in a small little shell so that
168
+ you don't have to keep typing 'fcst' before you do things.
169
+ * command line mode -- You can also just put the command after the fcst
170
+ script in your normal shell and it will run it directly.
171
+
172
+ The current shell is very primitive and doesn't support readline or many other
173
+ nice features.
174
+
175
+ If you want to get a list of commands then type 'help'. It actually isn't
176
+ a command, but the error message for giving an invalid command is to print
177
+ a list of all the commands available.
178
+
179
+
180
+ === Available Commands
181
+
182
+ FastCST currently supports the following commands:
183
+
184
+ * abort -- Aborts any currently in-process revision
185
+ * apply -- Applies a child revision to the current revision
186
+ * attach -- Attaches a file to the current in-process revision
187
+ * begin -- Starts a new in-process revision
188
+ * disp -- Adds a "disposition" reference to the in-process revision
189
+ * env -- Lists, searches, sets, and deletes environment variables
190
+ * finish -- Finalizes an in-process revision
191
+ * get -- Gets the latest published revisions from a URL
192
+ * init -- Sets up a new .fastcst repository in the current directory
193
+ * list -- Let's you list revisions and your current revision path
194
+ * log -- Adds a log line to the in-process revision (think Change Log)
195
+ * publish -- Publishes your repository to an FTP site so others can use get
196
+ * read -- Reads your "pending revision inbox" which contains received revisions
197
+ * recv -- Receives revisions from a POP3 account and stores them for read
198
+ * send -- Sends a chosen revision to a chosen person
199
+ * show -- Shows information about a revision, or the in-process revision
200
+ * status -- Gives a quick status of the current state of things
201
+ * undo -- Rolls back the most recent apply
202
+ * merge -- Basic revision merging. Does not handle conflicts yet (will abort).
203
+ * index -- Basic suffix array based searching through files.
204
+
205
+ All commands have a -h option, and will also complain if everything isn't perfect
206
+ when you run them. To get the list of commands just you can use ? or help.
207
+
208
+
209
+ === Your First Repository
210
+
211
+ FastCST uses a "project local" repository design. This means that, rather
212
+ than keeping everything in one master directory, it creates one directory
213
+ for each project. The directory is called .fastcst and simply sits at the
214
+ top of your source files.
215
+
216
+ What we're going to do is actually get the latest version of FastCST using
217
+ fcst. Make sure you've downloaded the script or built your own and then
218
+ do this:
219
+
220
+ 1. Create an empty directory and cd into it.
221
+ 2. Run fcst
222
+ 3. > init -e <your e-mail> -n <your name> -p fastcst
223
+ 4. > get -u http://www.zedshaw.com/fastcst/repository
224
+ 5. > list
225
+ 6. > show -r root
226
+ 7. > apply -r root
227
+
228
+ You now have the root revision of the FastCST 0.6 stuff. The list and show commands
229
+ aren't necessary, just a good idea so you don't apply something that will cause you
230
+ damage.
231
+
232
+ One current limit of fastcst is that when you get a remote repository it doesn't
233
+ ask you to apply all the revisions so you can sync up. I'm holding off on that
234
+ feature until I get the merging algorithm done. Until then, feel free to
235
+ apply the patches and play with the apply/merge/undo stuff.
236
+
237
+ ==== Other Things To Try
238
+
239
+ Here's some other stuff for you to try out:
240
+
241
+ 1. You do not need to have an empty directory to put files under fcst control.
242
+ 2. Make a changeset by using begin/finish. You can run begin, make some changes, and then
243
+ run finish to create the revision.
244
+ 3. Most commands that take a -r also take a -i so you can be specific about which revision
245
+ to use. Revision names are mostly just for weak humans who can't handle uuids.
246
+ 4. Use list, show, and status religiously to figure out what's going on.
247
+ 5. You can easily send a revision to someone else. Use send to give them one, and then
248
+ recv to get them from a POP3 account. It works like e-mail where they are downloaded,
249
+ and then you use 'read' to pick which ones you really want added to your repository.
250
+ 6. Most commands will look for settings in the environment and use them as defaults.
251
+ Try running a command without parameters and read the lines that talk about not finding
252
+ a setting in the environment. For example, recv will look for 'POP3 Host' so you can
253
+ do "env -s 'POP3 Host' -v mail.myserver.com:110" and it will never bug you again. If you
254
+ need to use a different one temporarily, then specifying the option will override the
255
+ environment setting.
256
+ 7. If you've got an FTP server and web server to play with, then you can try the publish/get
257
+ commands.
258
+ 8. All commands take a -h option so you can get extensive help.
259
+ 9. Try the index command. Run it once without options to build the index, then check -h.
260
+
261
+ === More Detailed Documentation
262
+
263
+ This README just gives you some quick advice to get you started. Better
264
+ documentation is available at http://www.zedshaw.com/projects/fastcst including
265
+ the full API documentation (which is also in doc/rdoc), tutorials, and several
266
+ other nice things.
267
+
268
+ === Reporting Bugs
269
+
270
+ Feel free to contact me at zedshaw AT zedshaw DOT com with any bug reports you have.
271
+ You may also find the latest release information at
272
+ http://www.zedshaw.com/projects/fastcst as well as contact me on irc.freenode.org
273
+ in the #ruby-lang or #rubyonrails channel.
274
+