amp 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (295) hide show
  1. data/.gitignore +1 -0
  2. data/.hgignore +26 -0
  3. data/AUTHORS +2 -0
  4. data/History.txt +6 -0
  5. data/LICENSE +37 -0
  6. data/MANIFESTO +7 -0
  7. data/Manifest.txt +294 -0
  8. data/README.md +129 -0
  9. data/Rakefile +102 -0
  10. data/SCHEDULE.markdown +12 -0
  11. data/STYLE +27 -0
  12. data/TODO.markdown +149 -0
  13. data/ampfile.rb +47 -0
  14. data/bin/amp +30 -0
  15. data/bin/amp1.9 +30 -0
  16. data/ext/amp/bz2/README.txt +39 -0
  17. data/ext/amp/bz2/bz2.c +1582 -0
  18. data/ext/amp/bz2/extconf.rb +77 -0
  19. data/ext/amp/bz2/mkmf.log +29 -0
  20. data/ext/amp/mercurial_patch/extconf.rb +5 -0
  21. data/ext/amp/mercurial_patch/mpatch.c +405 -0
  22. data/ext/amp/priority_queue/extconf.rb +5 -0
  23. data/ext/amp/priority_queue/priority_queue.c +947 -0
  24. data/ext/amp/support/extconf.rb +5 -0
  25. data/ext/amp/support/support.c +250 -0
  26. data/lib/amp.rb +200 -0
  27. data/lib/amp/commands/command.rb +507 -0
  28. data/lib/amp/commands/command_support.rb +137 -0
  29. data/lib/amp/commands/commands/config.rb +143 -0
  30. data/lib/amp/commands/commands/help.rb +29 -0
  31. data/lib/amp/commands/commands/init.rb +10 -0
  32. data/lib/amp/commands/commands/templates.rb +137 -0
  33. data/lib/amp/commands/commands/version.rb +7 -0
  34. data/lib/amp/commands/commands/workflow.rb +28 -0
  35. data/lib/amp/commands/commands/workflows/git/add.rb +65 -0
  36. data/lib/amp/commands/commands/workflows/git/copy.rb +27 -0
  37. data/lib/amp/commands/commands/workflows/git/mv.rb +23 -0
  38. data/lib/amp/commands/commands/workflows/git/rm.rb +60 -0
  39. data/lib/amp/commands/commands/workflows/hg/add.rb +53 -0
  40. data/lib/amp/commands/commands/workflows/hg/addremove.rb +86 -0
  41. data/lib/amp/commands/commands/workflows/hg/annotate.rb +46 -0
  42. data/lib/amp/commands/commands/workflows/hg/archive.rb +126 -0
  43. data/lib/amp/commands/commands/workflows/hg/branch.rb +28 -0
  44. data/lib/amp/commands/commands/workflows/hg/branches.rb +30 -0
  45. data/lib/amp/commands/commands/workflows/hg/bundle.rb +115 -0
  46. data/lib/amp/commands/commands/workflows/hg/clone.rb +95 -0
  47. data/lib/amp/commands/commands/workflows/hg/commit.rb +42 -0
  48. data/lib/amp/commands/commands/workflows/hg/copy.rb +31 -0
  49. data/lib/amp/commands/commands/workflows/hg/debug/dirstate.rb +32 -0
  50. data/lib/amp/commands/commands/workflows/hg/debug/index.rb +36 -0
  51. data/lib/amp/commands/commands/workflows/hg/default.rb +9 -0
  52. data/lib/amp/commands/commands/workflows/hg/diff.rb +30 -0
  53. data/lib/amp/commands/commands/workflows/hg/forget.rb +11 -0
  54. data/lib/amp/commands/commands/workflows/hg/heads.rb +25 -0
  55. data/lib/amp/commands/commands/workflows/hg/identify.rb +23 -0
  56. data/lib/amp/commands/commands/workflows/hg/import.rb +135 -0
  57. data/lib/amp/commands/commands/workflows/hg/incoming.rb +85 -0
  58. data/lib/amp/commands/commands/workflows/hg/info.rb +18 -0
  59. data/lib/amp/commands/commands/workflows/hg/log.rb +21 -0
  60. data/lib/amp/commands/commands/workflows/hg/manifest.rb +13 -0
  61. data/lib/amp/commands/commands/workflows/hg/merge.rb +53 -0
  62. data/lib/amp/commands/commands/workflows/hg/move.rb +28 -0
  63. data/lib/amp/commands/commands/workflows/hg/outgoing.rb +61 -0
  64. data/lib/amp/commands/commands/workflows/hg/pull.rb +74 -0
  65. data/lib/amp/commands/commands/workflows/hg/push.rb +20 -0
  66. data/lib/amp/commands/commands/workflows/hg/remove.rb +45 -0
  67. data/lib/amp/commands/commands/workflows/hg/resolve.rb +83 -0
  68. data/lib/amp/commands/commands/workflows/hg/revert.rb +53 -0
  69. data/lib/amp/commands/commands/workflows/hg/root.rb +13 -0
  70. data/lib/amp/commands/commands/workflows/hg/serve.rb +38 -0
  71. data/lib/amp/commands/commands/workflows/hg/status.rb +116 -0
  72. data/lib/amp/commands/commands/workflows/hg/tag.rb +69 -0
  73. data/lib/amp/commands/commands/workflows/hg/tags.rb +27 -0
  74. data/lib/amp/commands/commands/workflows/hg/tip.rb +13 -0
  75. data/lib/amp/commands/commands/workflows/hg/update.rb +27 -0
  76. data/lib/amp/commands/commands/workflows/hg/verify.rb +9 -0
  77. data/lib/amp/commands/commands/workflows/hg/view.rb +36 -0
  78. data/lib/amp/commands/dispatch.rb +181 -0
  79. data/lib/amp/commands/hooks.rb +81 -0
  80. data/lib/amp/dependencies/amp_support.rb +1 -0
  81. data/lib/amp/dependencies/amp_support/ruby_amp_support.rb +103 -0
  82. data/lib/amp/dependencies/minitar.rb +979 -0
  83. data/lib/amp/dependencies/priority_queue.rb +18 -0
  84. data/lib/amp/dependencies/priority_queue/c_priority_queue.rb +1 -0
  85. data/lib/amp/dependencies/priority_queue/poor_priority_queue.rb +46 -0
  86. data/lib/amp/dependencies/priority_queue/ruby_priority_queue.rb +525 -0
  87. data/lib/amp/dependencies/python_config.rb +211 -0
  88. data/lib/amp/dependencies/trollop.rb +713 -0
  89. data/lib/amp/dependencies/zip/ioextras.rb +155 -0
  90. data/lib/amp/dependencies/zip/stdrubyext.rb +111 -0
  91. data/lib/amp/dependencies/zip/tempfile_bugfixed.rb +186 -0
  92. data/lib/amp/dependencies/zip/zip.rb +1850 -0
  93. data/lib/amp/dependencies/zip/zipfilesystem.rb +609 -0
  94. data/lib/amp/dependencies/zip/ziprequire.rb +90 -0
  95. data/lib/amp/encoding/base85.rb +97 -0
  96. data/lib/amp/encoding/binary_diff.rb +82 -0
  97. data/lib/amp/encoding/difflib.rb +166 -0
  98. data/lib/amp/encoding/mercurial_diff.rb +378 -0
  99. data/lib/amp/encoding/mercurial_patch.rb +1 -0
  100. data/lib/amp/encoding/patch.rb +292 -0
  101. data/lib/amp/encoding/pure_ruby/ruby_mercurial_patch.rb +123 -0
  102. data/lib/amp/extensions/ditz.rb +41 -0
  103. data/lib/amp/extensions/lighthouse.rb +167 -0
  104. data/lib/amp/graphs/ancestor.rb +147 -0
  105. data/lib/amp/graphs/copies.rb +261 -0
  106. data/lib/amp/merges/merge_state.rb +164 -0
  107. data/lib/amp/merges/merge_ui.rb +322 -0
  108. data/lib/amp/merges/simple_merge.rb +450 -0
  109. data/lib/amp/profiling_hacks.rb +36 -0
  110. data/lib/amp/repository/branch_manager.rb +234 -0
  111. data/lib/amp/repository/dir_state.rb +950 -0
  112. data/lib/amp/repository/journal.rb +203 -0
  113. data/lib/amp/repository/lock.rb +207 -0
  114. data/lib/amp/repository/repositories/bundle_repository.rb +214 -0
  115. data/lib/amp/repository/repositories/http_repository.rb +377 -0
  116. data/lib/amp/repository/repositories/local_repository.rb +2661 -0
  117. data/lib/amp/repository/repository.rb +94 -0
  118. data/lib/amp/repository/store.rb +485 -0
  119. data/lib/amp/repository/tag_manager.rb +319 -0
  120. data/lib/amp/repository/updatable.rb +532 -0
  121. data/lib/amp/repository/verification.rb +431 -0
  122. data/lib/amp/repository/versioned_file.rb +475 -0
  123. data/lib/amp/revlogs/bundle_revlogs.rb +246 -0
  124. data/lib/amp/revlogs/changegroup.rb +217 -0
  125. data/lib/amp/revlogs/changelog.rb +338 -0
  126. data/lib/amp/revlogs/changeset.rb +521 -0
  127. data/lib/amp/revlogs/file_log.rb +165 -0
  128. data/lib/amp/revlogs/index.rb +493 -0
  129. data/lib/amp/revlogs/manifest.rb +195 -0
  130. data/lib/amp/revlogs/node.rb +18 -0
  131. data/lib/amp/revlogs/revlog.rb +1032 -0
  132. data/lib/amp/revlogs/revlog_support.rb +126 -0
  133. data/lib/amp/server/amp_user.rb +44 -0
  134. data/lib/amp/server/extension/amp_extension.rb +396 -0
  135. data/lib/amp/server/extension/authorization.rb +201 -0
  136. data/lib/amp/server/fancy_http_server.rb +252 -0
  137. data/lib/amp/server/fancy_views/_browser.haml +28 -0
  138. data/lib/amp/server/fancy_views/_diff_file.haml +13 -0
  139. data/lib/amp/server/fancy_views/_navbar.haml +17 -0
  140. data/lib/amp/server/fancy_views/changeset.haml +31 -0
  141. data/lib/amp/server/fancy_views/commits.haml +32 -0
  142. data/lib/amp/server/fancy_views/file.haml +35 -0
  143. data/lib/amp/server/fancy_views/file_diff.haml +23 -0
  144. data/lib/amp/server/fancy_views/harshcss/all_hallows_eve.css +72 -0
  145. data/lib/amp/server/fancy_views/harshcss/amy.css +147 -0
  146. data/lib/amp/server/fancy_views/harshcss/twilight.css +138 -0
  147. data/lib/amp/server/fancy_views/stylesheet.sass +175 -0
  148. data/lib/amp/server/http_server.rb +140 -0
  149. data/lib/amp/server/repo_user_management.rb +287 -0
  150. data/lib/amp/support/amp_config.rb +164 -0
  151. data/lib/amp/support/amp_ui.rb +287 -0
  152. data/lib/amp/support/docs.rb +54 -0
  153. data/lib/amp/support/generator.rb +78 -0
  154. data/lib/amp/support/ignore.rb +144 -0
  155. data/lib/amp/support/loaders.rb +93 -0
  156. data/lib/amp/support/logger.rb +103 -0
  157. data/lib/amp/support/match.rb +151 -0
  158. data/lib/amp/support/multi_io.rb +87 -0
  159. data/lib/amp/support/openers.rb +121 -0
  160. data/lib/amp/support/ruby_19_compatibility.rb +66 -0
  161. data/lib/amp/support/support.rb +1095 -0
  162. data/lib/amp/templates/blank.commit.erb +23 -0
  163. data/lib/amp/templates/blank.log.erb +18 -0
  164. data/lib/amp/templates/default.commit.erb +23 -0
  165. data/lib/amp/templates/default.log.erb +26 -0
  166. data/lib/amp/templates/template.rb +165 -0
  167. data/site/Rakefile +24 -0
  168. data/site/src/about/ampfile.haml +57 -0
  169. data/site/src/about/commands.haml +106 -0
  170. data/site/src/about/index.haml +33 -0
  171. data/site/src/about/performance.haml +31 -0
  172. data/site/src/about/workflows.haml +34 -0
  173. data/site/src/contribute/index.haml +65 -0
  174. data/site/src/contribute/style.haml +297 -0
  175. data/site/src/css/active4d.css +114 -0
  176. data/site/src/css/all_hallows_eve.css +72 -0
  177. data/site/src/css/all_themes.css +3299 -0
  178. data/site/src/css/amp.css +260 -0
  179. data/site/src/css/amy.css +147 -0
  180. data/site/src/css/blackboard.css +88 -0
  181. data/site/src/css/brilliance_black.css +605 -0
  182. data/site/src/css/brilliance_dull.css +599 -0
  183. data/site/src/css/cobalt.css +149 -0
  184. data/site/src/css/cur_amp.css +185 -0
  185. data/site/src/css/dawn.css +121 -0
  186. data/site/src/css/eiffel.css +121 -0
  187. data/site/src/css/espresso_libre.css +109 -0
  188. data/site/src/css/idle.css +62 -0
  189. data/site/src/css/iplastic.css +80 -0
  190. data/site/src/css/lazy.css +73 -0
  191. data/site/src/css/mac_classic.css +123 -0
  192. data/site/src/css/magicwb_amiga.css +104 -0
  193. data/site/src/css/pastels_on_dark.css +188 -0
  194. data/site/src/css/reset.css +55 -0
  195. data/site/src/css/slush_poppies.css +85 -0
  196. data/site/src/css/spacecadet.css +51 -0
  197. data/site/src/css/sunburst.css +180 -0
  198. data/site/src/css/twilight.css +137 -0
  199. data/site/src/css/zenburnesque.css +91 -0
  200. data/site/src/get/index.haml +32 -0
  201. data/site/src/helpers.rb +121 -0
  202. data/site/src/images/amp_logo.png +0 -0
  203. data/site/src/images/carbonica.png +0 -0
  204. data/site/src/images/revolution.png +0 -0
  205. data/site/src/images/tab-bg.png +0 -0
  206. data/site/src/images/tab-sliding-left.png +0 -0
  207. data/site/src/images/tab-sliding-right.png +0 -0
  208. data/site/src/include/_footer.haml +22 -0
  209. data/site/src/include/_header.haml +17 -0
  210. data/site/src/index.haml +104 -0
  211. data/site/src/learn/index.haml +46 -0
  212. data/site/src/scripts/jquery-1.3.2.min.js +19 -0
  213. data/site/src/scripts/jquery.cookie.js +96 -0
  214. data/tasks/stats.rake +155 -0
  215. data/tasks/yard.rake +171 -0
  216. data/test/dirstate_tests/dirstate +0 -0
  217. data/test/dirstate_tests/hgrc +5 -0
  218. data/test/dirstate_tests/test_dir_state.rb +192 -0
  219. data/test/functional_tests/resources/.hgignore +2 -0
  220. data/test/functional_tests/resources/STYLE.txt +25 -0
  221. data/test/functional_tests/resources/command.rb +372 -0
  222. data/test/functional_tests/resources/commands/annotate.rb +57 -0
  223. data/test/functional_tests/resources/commands/experimental/lolcats.rb +17 -0
  224. data/test/functional_tests/resources/commands/heads.rb +22 -0
  225. data/test/functional_tests/resources/commands/manifest.rb +12 -0
  226. data/test/functional_tests/resources/commands/status.rb +90 -0
  227. data/test/functional_tests/resources/version2/.hgignore +5 -0
  228. data/test/functional_tests/resources/version2/STYLE.txt +25 -0
  229. data/test/functional_tests/resources/version2/command.rb +372 -0
  230. data/test/functional_tests/resources/version2/commands/annotate.rb +45 -0
  231. data/test/functional_tests/resources/version2/commands/experimental/lolcats.rb +17 -0
  232. data/test/functional_tests/resources/version2/commands/heads.rb +22 -0
  233. data/test/functional_tests/resources/version2/commands/manifest.rb +12 -0
  234. data/test/functional_tests/resources/version2/commands/status.rb +90 -0
  235. data/test/functional_tests/resources/version3/.hgignore +5 -0
  236. data/test/functional_tests/resources/version3/STYLE.txt +31 -0
  237. data/test/functional_tests/resources/version3/command.rb +376 -0
  238. data/test/functional_tests/resources/version3/commands/annotate.rb +45 -0
  239. data/test/functional_tests/resources/version3/commands/experimental/lolcats.rb +17 -0
  240. data/test/functional_tests/resources/version3/commands/heads.rb +22 -0
  241. data/test/functional_tests/resources/version3/commands/manifest.rb +12 -0
  242. data/test/functional_tests/resources/version3/commands/status.rb +90 -0
  243. data/test/functional_tests/resources/version4/.hgignore +5 -0
  244. data/test/functional_tests/resources/version4/STYLE.txt +31 -0
  245. data/test/functional_tests/resources/version4/command.rb +376 -0
  246. data/test/functional_tests/resources/version4/commands/experimental/lolcats.rb +17 -0
  247. data/test/functional_tests/resources/version4/commands/heads.rb +22 -0
  248. data/test/functional_tests/resources/version4/commands/manifest.rb +12 -0
  249. data/test/functional_tests/resources/version4/commands/stats.rb +25 -0
  250. data/test/functional_tests/resources/version4/commands/status.rb +90 -0
  251. data/test/functional_tests/resources/version5_1/.hgignore +5 -0
  252. data/test/functional_tests/resources/version5_1/STYLE.txt +2 -0
  253. data/test/functional_tests/resources/version5_1/command.rb +374 -0
  254. data/test/functional_tests/resources/version5_1/commands/experimental/lolcats.rb +17 -0
  255. data/test/functional_tests/resources/version5_1/commands/heads.rb +22 -0
  256. data/test/functional_tests/resources/version5_1/commands/manifest.rb +12 -0
  257. data/test/functional_tests/resources/version5_1/commands/stats.rb +25 -0
  258. data/test/functional_tests/resources/version5_1/commands/status.rb +90 -0
  259. data/test/functional_tests/resources/version5_2/.hgignore +5 -0
  260. data/test/functional_tests/resources/version5_2/STYLE.txt +14 -0
  261. data/test/functional_tests/resources/version5_2/command.rb +376 -0
  262. data/test/functional_tests/resources/version5_2/commands/experimental/lolcats.rb +17 -0
  263. data/test/functional_tests/resources/version5_2/commands/manifest.rb +12 -0
  264. data/test/functional_tests/resources/version5_2/commands/newz.rb +12 -0
  265. data/test/functional_tests/resources/version5_2/commands/stats.rb +25 -0
  266. data/test/functional_tests/resources/version5_2/commands/status.rb +90 -0
  267. data/test/functional_tests/test_functional.rb +604 -0
  268. data/test/localrepo_tests/test_local_repo.rb +121 -0
  269. data/test/localrepo_tests/testrepo.tar.gz +0 -0
  270. data/test/manifest_tests/00manifest.i +0 -0
  271. data/test/manifest_tests/test_manifest.rb +72 -0
  272. data/test/merge_tests/base.txt +10 -0
  273. data/test/merge_tests/expected.local.txt +16 -0
  274. data/test/merge_tests/local.txt +11 -0
  275. data/test/merge_tests/remote.txt +11 -0
  276. data/test/merge_tests/test_merge.rb +26 -0
  277. data/test/revlog_tests/00changelog.i +0 -0
  278. data/test/revlog_tests/revision_added_changelog.i +0 -0
  279. data/test/revlog_tests/test_adding_index.i +0 -0
  280. data/test/revlog_tests/test_revlog.rb +333 -0
  281. data/test/revlog_tests/testindex.i +0 -0
  282. data/test/store_tests/store.tar.gz +0 -0
  283. data/test/store_tests/test_fncache_store.rb +122 -0
  284. data/test/test_amp.rb +9 -0
  285. data/test/test_base85.rb +14 -0
  286. data/test/test_bdiff.rb +42 -0
  287. data/test/test_commands.rb +122 -0
  288. data/test/test_difflib.rb +50 -0
  289. data/test/test_helper.rb +15 -0
  290. data/test/test_journal.rb +29 -0
  291. data/test/test_match.rb +134 -0
  292. data/test/test_mdiff.rb +74 -0
  293. data/test/test_mpatch.rb +14 -0
  294. data/test/test_support.rb +24 -0
  295. metadata +385 -0
@@ -0,0 +1,91 @@
1
+ pre.zenburnesque .InheritedClass {
2
+ }
3
+ pre.zenburnesque .TypeName {
4
+ color: #F09040;
5
+ }
6
+ pre.zenburnesque .FloatingPointPrefixOperators {
7
+ text-decoration: underline;
8
+ }
9
+ pre.zenburnesque .Number {
10
+ color: #22C0FF;
11
+ }
12
+ pre.zenburnesque .Directive {
13
+ font-weight: bold;
14
+ }
15
+ pre.zenburnesque .LibraryVariable {
16
+ }
17
+ pre.zenburnesque .Storage {
18
+ }
19
+ pre.zenburnesque .line-numbers {
20
+ background-color: #A0A0C0;
21
+ color: #000000;
22
+ }
23
+ pre.zenburnesque .LineNumberDirectives {
24
+ text-decoration: underline;
25
+ }
26
+ pre.zenburnesque .TagName {
27
+ }
28
+ pre.zenburnesque .StorageTypes {
29
+ color: #6080FF;
30
+ }
31
+ pre.zenburnesque .Operators {
32
+ color: #FFFFA0;
33
+ }
34
+ pre.zenburnesque {
35
+ background-color: #404040;
36
+ color: #DEDEDE;
37
+ }
38
+ pre.zenburnesque .LibraryConstant {
39
+ }
40
+ pre.zenburnesque .VariantTypes {
41
+ color: #4080A0;
42
+ }
43
+ pre.zenburnesque .Characters {
44
+ color: #FF8080;
45
+ }
46
+ pre.zenburnesque .FunctionArgument {
47
+ }
48
+ pre.zenburnesque .LanguageKeyword {
49
+ color: #FFFFA0;
50
+ }
51
+ pre.zenburnesque .BuiltInConstant {
52
+ }
53
+ pre.zenburnesque .FloatingPointNumbers {
54
+ text-decoration: underline;
55
+ }
56
+ pre.zenburnesque .ClassTypeName {
57
+ color: #F4A020;
58
+ }
59
+ pre.zenburnesque .TypeName1 {
60
+ color: #FFE000;
61
+ }
62
+ pre.zenburnesque .ModuleKeyword {
63
+ font-weight: bold;
64
+ color: #FF8000;
65
+ }
66
+ pre.zenburnesque .Invalid {
67
+ }
68
+ pre.zenburnesque .LibraryClassType {
69
+ }
70
+ pre.zenburnesque .LibraryFunction {
71
+ }
72
+ pre.zenburnesque .TagAttribute {
73
+ }
74
+ pre.zenburnesque .FloatingPointInfixOperators {
75
+ text-decoration: underline;
76
+ }
77
+ pre.zenburnesque .UserDefinedConstant {
78
+ }
79
+ pre.zenburnesque .String {
80
+ color: #FF2020;
81
+ }
82
+ pre.zenburnesque .FunctionName {
83
+ font-weight: bold;
84
+ color: #FFCC66;
85
+ }
86
+ pre.zenburnesque .Variable {
87
+ }
88
+ pre.zenburnesque .Comment {
89
+ color: #709070;
90
+ font-style: italic;
91
+ }
@@ -0,0 +1,32 @@
1
+ !!! 1.1
2
+ %html{ :xmlns => "http://www.w3.org/1999/xhtml" }
3
+ %head
4
+ %meta{ :content => "text/html; charset=UTF-8", "http-equiv" => "Content-Type" }
5
+ %title
6
+ Amp | Version Control Revolution | Get Amp
7
+ = stylesheets :reset, :amp, :all_themes
8
+ = javascripts "jquery-1.3.2.min.js", "jquery.cookie.js"
9
+ %body.oneColFixCtr
10
+ = render("include/_header.haml", :selected => "get")
11
+ .infopage#container
12
+ .body-width
13
+ .floatleft{ :style => "width:90%; padding:8px 0em 6px; margin-left:5%;"}
14
+ %h2 Get #{blue_amp "Amp"}
15
+ %p
16
+ Amp is written in #{ruby_link}, so you'll need that first. We don't have a self-contained installer, yet. If you'd like to help with that, #{link_to "/contribute/", "check out how to help"}!
17
+ %p
18
+ Amp also has a couple other, very basic, requirements right now.
19
+ %ul.bullets{:style => "margin-left:2em;"}
20
+ %li Linux or Mac OS X. Testing on Linux has been minimal as of yet
21
+ %li Ruby 1.8.6+, Ruby 1.9
22
+ %li A C compiler is required for #{blue_amp}'s high-performance extensions
23
+ %p
24
+ Once you have #{ruby_link}, you simply need to run the following command from your favorite command line:
25
+ .floatleft.dark.rounded.codeholder
26
+ :syntaxhighlighter
27
+ #!highlighting syntax=shell-unix-generic
28
+ sudo gem install amp --no-wrappers
29
+ %p
30
+ Amp's gem is hosted on #{link_to "http://www.rubyforge.org/", "Rubyforge"} and #{link_to "http://www.gemcutter.org/", "Gemcutter"}.
31
+
32
+ = render("include/_footer.haml")
@@ -0,0 +1,121 @@
1
+ require 'uv'
2
+ require 'haml'
3
+ def stylesheet(*args)
4
+ result = []
5
+ args.each do |name|
6
+ result << %Q{<link href="/css/#{name}.css" rel="stylesheet" type="text/css" />}
7
+ end
8
+ result.join("\n")
9
+ end
10
+ alias :stylesheets :stylesheet
11
+
12
+ def render(path, locals={})
13
+ path = (path =~ /src/ ? path : File.join(File.dirname(__FILE__), path))
14
+ haml = Haml::Engine.new(File.read(path))
15
+ return haml.render(Object.new, locals)
16
+ end
17
+
18
+ def javascript(*scripts)
19
+ result = []
20
+ scripts.each do |name|
21
+ result << %Q{<script language='javascript' src='/scripts/#{name}' type='text/javascript'></script>}
22
+ end
23
+ result.join("\n")
24
+ end
25
+ alias :javascripts :javascript
26
+
27
+ def shellscript(text)
28
+ "<span class='shellscript'>#{text}</span>"
29
+ end
30
+
31
+ def symbol(text)
32
+ "<span class='ruby-symbol'>#{text.is_a?(Symbol) ? text.inspect : text}</span>"
33
+ end
34
+
35
+
36
+
37
+ def ruby_link(text = "Ruby")
38
+ link_to "http://www.ruby-lang.org/", text
39
+ end
40
+
41
+ def git_link(text = "git")
42
+ link_to "http://git-scm.com/", text
43
+ end
44
+
45
+ def hg_link(text = "Mercurial")
46
+ link_to "http://mercurial.selenic.com/", text
47
+ end
48
+
49
+ def yard_link(text = "YARD")
50
+ link_to "http://yard.soen.ca/", text
51
+ end
52
+
53
+ def lighthouse_link(text = "Lighthouse")
54
+ link_to "http://carbonica.lighthouseapp.com/projects/35539-amp/tickets/new", text
55
+ end
56
+
57
+ %w(workflows ampfile commands).each do |link|
58
+ eval %Q{
59
+ def #{link}_link(text="#{link}")
60
+ link_to "/about/#{link}.html", text
61
+ end
62
+ }
63
+ end
64
+
65
+ def contribute_link(text = "contribute")
66
+ link_to "/contribute/", text
67
+ end
68
+
69
+ def link_to(link, text)
70
+ "<a href='#{link}'>#{text}</a>"
71
+ end
72
+
73
+ def blue_amp(text = "amp")
74
+ "<span class='amp'>#{text}</span>"
75
+ end
76
+
77
+ def commit_count
78
+ path_to_amp = File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "bin", "amp"))
79
+ hash = %x(#{path_to_amp} stats).split("\n").inject({}) do |hash, line|
80
+ result = line.split(/\s+/)
81
+ next unless result.size >= 2
82
+ hash[result[0][0..-2]] = result[1].to_i
83
+ hash
84
+ end
85
+ hash["<a href='http://carboni.ca/contact/'>adgar</a>"] = hash.delete("michaeledgar") + 558 # old repo
86
+ hash["<a href='http://carboni.ca/contact/'>seydar</a>"] = hash.delete("seydar") + (hash.delete("ari") || 0) + 251 # old repo
87
+
88
+ hash = hash.sort do |(key1, value1), (key2, value2)|
89
+ value2 <=> value1
90
+ end
91
+ hash
92
+ end
93
+
94
+ def themes
95
+ [ :active4d, :all_hallows_eve, :amy, :blackboard, :brilliance_black, :brilliance_dull,
96
+ :cobalt, :dawn, :eiffel, :espresso_libre, :idle, :iplastic, :lazy, :mac_classic, :magicwb_amiga,
97
+ :pastels_on_dark, :slush_poppies, :spacecadet, :sunburst, :twilight, :zenburnesque]
98
+ end
99
+
100
+ module SyntaxHighlighter
101
+ include Haml::Filters::Base
102
+ def initialize(text)
103
+ @text = highlight_text(text)
104
+ end
105
+ def highlight_text(text, opts = {:format => "ruby", :theme => "twilight", :lines => false})
106
+ Uv.parse( text, "xhtml", opts[:format], opts[:lines], opts[:theme])
107
+ end
108
+ def render(text)
109
+ all_lines = text.split(/\n/)
110
+ if all_lines.first =~ /#!highlighting/
111
+ line = all_lines.first
112
+ syntax = (line =~ /syntax=([\w-]+)/) ? $1 : "ruby"
113
+ theme = (line =~ /theme=(\w+)/) ? $1 : "twilight"
114
+ lines = (line =~ /lines=(\w+)/) ? ($1 == 'true') : false
115
+ text = all_lines[1..-1].join("\n")
116
+ Haml::Helpers.preserve(highlight_text(text.rstrip, :format => syntax, :theme => theme, :lines => lines))
117
+ else
118
+ Haml::Helpers.preserve(highlight_text(text.rstrip))
119
+ end
120
+ end
121
+ end
@@ -0,0 +1,22 @@
1
+ #footer
2
+ .body-width
3
+ .floatleft{ :style => "width:100%;" }
4
+ %a{:href => "http://www.carboni.ca/" }
5
+ %img{ :src => "/images/carbonica.png", :height => "50", :width => "244" }
6
+ %form
7
+ %select#picker
8
+ - themes.each do |theme|
9
+ %option{:name => theme.to_s, :value => theme.to_s}= theme.to_s
10
+ :javascript
11
+ $(function() {
12
+ $("#picker").change(function() {
13
+ var val = $("#picker option:selected").val();
14
+ $("pre").attr("class","").addClass("code").addClass(val);
15
+ $.cookie("codetheme", val);
16
+ });
17
+ var currentCookie = $.cookie("codetheme");
18
+ if (currentCookie) {
19
+ $("#picker").val(currentCookie);
20
+ $("#picker").change();
21
+ }
22
+ });
@@ -0,0 +1,17 @@
1
+ #header
2
+ .body-width
3
+ .floatleft{ :style => "height:90px;width:100%;" }
4
+ %a{:href => "/"}
5
+ %img#amp-logo{ :src => "/images/amp_logo.png", :height => "111", :alt => "Amp - Version Control Revolution", :width => "82" }
6
+ %img#amp-revolution{ :src => "/images/revolution.png", :height => "16", :width => "200" }
7
+ %ul#navbar
8
+ %li{ :class => selected == "home" && "selected"}
9
+ %a{ :href => "/" } Home
10
+ %li{ :class => selected == "about" && "selected"}
11
+ %a{ :href => "/about/" } About Amp
12
+ %li{ :class => selected == "get" && "selected"}
13
+ %a{ :href => "/get/" } Get Amp
14
+ %li{ :class => selected == "learn" && "selected"}
15
+ %a{ :href => "/learn/" } Learn Amp
16
+ %li{ :class => selected == "contribute" && "selected"}
17
+ %a{ :href => "/contribute/" } Contribute to Amp
@@ -0,0 +1,104 @@
1
+ !!! 1.1
2
+ %html{ :xmlns => "http://www.w3.org/1999/xhtml" }
3
+ %head
4
+ %meta{ :content => "text/html; charset=UTF-8", "http-equiv" => "Content-Type" }
5
+ %title
6
+ Amp | Version Control Revolution
7
+ = stylesheets :reset, :amp, :all_themes
8
+ = javascripts "jquery-1.3.2.min.js", "jquery.cookie.js"
9
+ %body.oneColFixCtr
10
+ = render("include/_header.haml", :selected => "home")
11
+ #container
12
+ .body-width
13
+ .floatleft{ :style => "width:100%; padding:8px 0em 6px;"}
14
+ .floatleft{ :style => "width: 50%; margin-left: 25%;" }
15
+ .rounded.bigbox.pink
16
+ %h1#latest-version
17
+ Get Amp
18
+ %span.red-text v0.2.3
19
+ %ul{:style => "margin-left:2px;"}
20
+ %li== 1. Get #{ruby_link}. 2. sudo gem install #{blue_amp} --no-wrappers
21
+ .floatleft{ :style => "width:100%;padding:10px 0em 6px;" }
22
+ .floatleft{ :style => "width: 45%;" }
23
+ %span.section-header== What is #{blue_amp("Amp:")}
24
+ .rounded.bigbox.half-border{:style => "padding-bottom:30px;"}
25
+ %p
26
+ == #{blue_amp "Amp"} aims to change the way we approach VCS.
27
+ %br/
28
+ == #{blue_amp "Amp"} is:
29
+ %ul.bullets
30
+ %li== #{hg_link} in #{link_to "http://www.ruby-lang.org/", "Ruby"}. 100% compatible with hg.
31
+ %li== Uniquely #{link_to "/about/customization.html", "customizable"}
32
+ %li== Superbly #{link_to "/docs/", "documented"} with #{link_to "http://yard.soen.ca/", "YARD"}
33
+ %li== Free and Open-Source (#{link_to "http://www.gnu.org/licenses/gpl-2.0.html", "GPLv2"})
34
+ %li== #{link_to "/about/performance.html", "Performance"} Focused
35
+ %li Dependency-free (you just need Ruby!)
36
+ .floatleft{ :style => "width: 53%; margin-left:14px;" }
37
+ %span.section-header
38
+ ==Big Plans for #{blue_amp "Amp:"}
39
+ .rounded.bigbox.half-border
40
+ %p
41
+ ==#{blue_amp "Amp"} has bigger dreams. Here’s what we <em>want</em> to do:
42
+ %ul.bullets
43
+ %li
44
+ == #{git_link}, #{link_to "http://bazaar-vcs.org/", "bazaar"}, #{link_to "http://subversion.tigris.org/", "svn"}, #{link_to "http://www.nongnu.org/cvs/", "cvs" }, #{link_to "http://darcs.net/", "darcs" } In #{link_to "http://www.ruby-lang.org/", "Ruby" }. 100% Compatible.
45
+ %li Common API to all repository formats.
46
+ %li== #{link_to "about/commands.html", "Command system"} independent of repository format
47
+ %li Workflows matching each major VCS system
48
+ %li== Run on #{link_to "http://www.microsoft.com/en/us/default.aspx", "Windows" }
49
+ %li== Demonstrate Ruby #{link_to "about/performance.html", "performance"}
50
+ %li A GUI application on top of all these features
51
+ %p
52
+ == Ambitious? Perhaps. That’s why #{link_to "contribute/", "we'd like your help"}.
53
+ .floatleft{ :style => "width:100%;padding:6px 0em 6px 0em;" }
54
+ .floatleft{ :style => "width: 62%;" }
55
+ %span.section-header== Why #{blue_amp "Amp?"}
56
+ .rounded.bigbox
57
+ %p== #{blue_amp "Amp"} is unlike any other VCS software to date. #{blue_amp "Amp"}'s novel command system gives you the flexibility to customize and personalize the way you develop software. Create in your own workspace with full #{hg_link} compatibility, and no external dependencies.
58
+ .rounded.bigbox.dark{ :style => "margin-top:16px;" }
59
+ :syntaxhighlighter
60
+ command "echo" do |c|
61
+ c.opt :noline, "Don't append newline", :short => "-n"
62
+ c.on_run do |opts, args|
63
+ print args.join(" ")
64
+ print "\n" unless opts[:noline]
65
+ end
66
+ end
67
+ .rounded.bigbox.teal{ :style => "margin-top:0px;" }
68
+ %p
69
+ ==Adds a new command to #{blue_amp}. Usage:
70
+ %tt amp echo Hello World.
71
+ == Once this is in your #{ampfile_link}, it’s usable in amp. #{link_to "about/commands.html", "Learn More"}
72
+ .floatleft{ :style => "width: 38%;margin-top:25px;" }
73
+ .rounded.bigbox.dark
74
+ :syntaxhighlighter
75
+ command "status" do |c|
76
+ c.default :"no-color", true
77
+ end
78
+ .rounded.bigbox.teal{ :style => "margin-top:0px; margin-bottom:8px;" }
79
+ %p
80
+ Don’t like how a command works out-of-the-box? Change the default settings. It’s almost not even code.
81
+ .rounded.bigbox.dark{ :style => "margin-top:8px; margin-bottom:0px;" }
82
+ :syntaxhighlighter
83
+ command :push do |c|
84
+ c.before { system "rake test" }
85
+ end
86
+ .rounded.bigbox.teal{ :style => "margin-top:0px;" }
87
+ %p
88
+ == This one's from our own #{ampfile_link}. Run tests before every push. If your tests fail, no push.
89
+ .floatleft{ :style => "width:100%; padding:1em 0em 6px;" }
90
+ .floatleft{ :style => "width: 81%;margin-left:9.5%;" }
91
+ %span.section-header
92
+ == Developing #{blue_amp "Amp:"}
93
+ .rounded.bigbox
94
+ %p== There's a lot we want to do, and #{blue_amp} needs developers. Want to help? Here's how #{blue_amp} rolls:
95
+ %ul.bullets
96
+ %li
97
+ %span.shellscript hg clone http://bitbucket.org/carbonica/amp/
98
+ %li Make your changes
99
+ %li
100
+ %span.shellscript hg diff -r rev1 -r rev2 -U 3 > your.patch
101
+ %li Create ticket on #{lighthouse_link "Lighthouse, attach your patch"}
102
+ %li Land one patch, you get commit rights
103
+ %p== Want more details? Check out our #{link_to "/contributing/", "contributing page." } Or join us at #{link_to "irc://irc.freenode.net/#amp", "#amp on freenode" }.
104
+ = render("include/_footer.haml")
@@ -0,0 +1,46 @@
1
+ !!! 1.1
2
+ %html{ :xmlns => "http://www.w3.org/1999/xhtml" }
3
+ %head
4
+ %meta{ :content => "text/html; charset=UTF-8", "http-equiv" => "Content-Type" }
5
+ %title
6
+ Amp | Version Control Revolution | Learn Amp
7
+ = stylesheets :reset, :amp, :all_themes
8
+ = javascripts "jquery-1.3.2.min.js", "jquery.cookie.js"
9
+ %body.oneColFixCtr
10
+ - @selected = "learn"
11
+ = render("include/_header.haml", :selected => "learn")
12
+ #container
13
+ .body-width
14
+ .floatleft{ :style => "width:90%; padding:8px 0em 6px; margin-left:5%;"}
15
+ %br/
16
+ %h2 Learning #{blue_amp("Amp")}
17
+ %p
18
+ Amp is still in its building stages, but there are some things to learn about it that are different from other VCS software.
19
+ Currently, the main commands are (nearly) identical to #{hg_link}'s, so you should know how to use Mercurial before using
20
+ #{blue_amp}. There's still plenty of other things that are different.
21
+ %h2 Templates
22
+ %p
23
+ Templates are damn important to us. We're still hammering out the API, but if you run
24
+ %span.shellscript amp templates
25
+ you can use our interactive template editor. You can write templates in #{link_to "http://www.ruby-doc.org/stdlib/libdoc/erb/rdoc/index.html", "ERb"}, and access all the variables #{blue_amp} has. At the moment, #{blue_amp} only comes with one template for viewing changesets (such as in
26
+ %span.shellscript amp log
27
+ or
28
+ %span.shellscript amp head
29
+ ), and one template for commit messages. Both match (roughly) the default templates used by #{hg_link}. However, you can add your own, and save them as either global templates (usable in any repository) or local (usable only in the current repository).
30
+ %h2 Ampfiles
31
+ %p
32
+ The #{ampfile_link} is how you handle high-level configuration of an #{blue_amp} repository. This is where you add commands, hooks, modify command defaults, and so on. We have a full page discussing ampfiles #{ampfile_link "here"}, but we'll leave you with this snippet.
33
+ .floatleft.dark.rounded.codeholder
34
+ :syntaxhighlighter
35
+ command :push do |c|
36
+ c.before { system "rake test" }
37
+ end
38
+ %p
39
+ Those 3 lines add a block of code which will run every time you run
40
+ %span.shellscript amp push
41
+ , right before the actual push happens, which will run unit tests. If a test fails, the block returns false, which cancels the push. If the tests pass, the block returns true, and the push happens.
42
+ %h2
43
+ = link_to "/docs/", "API Documentation"
44
+ %p
45
+ One of the most important aspects of our code is that it should be highly documented. We're sitting at around 45% comment/LOC ratio, and there's still plenty of places we want more documentation. We use #{yard_link} to document our code. You can find the complete documentation for our code (and the dependencies we've included in the #{blue_amp} source) by clicking "API Documentation" above, or just clicking #{link_to "/docs/", "right here"}.
46
+ = render("include/_footer.haml")