You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by rn...@apache.org on 2013/12/16 17:49:06 UTC

[09/10] git commit: updated refs/heads/1843-feature-bigcouch to 938fc01

Import rebar


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/626455a4
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/626455a4
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/626455a4

Branch: refs/heads/1843-feature-bigcouch
Commit: 626455a47a39e416f504b7df54c823bb40e922be
Parents: cba2e81
Author: Robert Newson <rn...@apache.org>
Authored: Mon Dec 16 00:17:26 2013 +0100
Committer: Robert Newson <rn...@apache.org>
Committed: Mon Dec 16 00:17:26 2013 +0100

----------------------------------------------------------------------
 src/rebar/.gitignore                            |  12 +
 src/rebar/.travis.yml                           |   8 +
 src/rebar/CONTRIBUTING.md                       |  94 +++
 src/rebar/LICENSE                               | 178 ++++
 src/rebar/Makefile                              |  44 +
 src/rebar/NOTES.org                             |  28 +
 src/rebar/README.md                             |  79 ++
 src/rebar/THANKS                                | 122 +++
 src/rebar/bootstrap                             | 118 +++
 src/rebar/bootstrap.bat                         |   2 +
 src/rebar/dialyzer_reference                    |   3 +
 src/rebar/ebin/rebar.app                        |  93 ++
 src/rebar/include/rebar.hrl                     |  14 +
 src/rebar/inttest/bug_5_rt.erl                  |  29 +
 src/rebar/inttest/ct1/ct1_rt.erl                |  28 +
 src/rebar/inttest/ct1/rebar.config              |   1 +
 src/rebar/inttest/ct1/test_SUITE.erl            |  11 +
 src/rebar/inttest/ct2/ct2_rt.erl                |  26 +
 src/rebar/inttest/ct2/foo.test.spec             |   1 +
 src/rebar/inttest/ct2/foo_SUITE.erl             |  10 +
 src/rebar/inttest/depplugins/depplugins_rt.erl  |  50 ++
 src/rebar/inttest/depplugins/rebar.config       |   1 +
 .../depplugins/rebar_dependsonplugin.config     |   2 +
 src/rebar/inttest/depplugins/testplugin_mod.erl |   6 +
 src/rebar/inttest/rgen1/reltool.config          |  31 +
 src/rebar/inttest/rgen1/retest.config           |   1 +
 src/rebar/inttest/rgen1/rgen1_rt.erl            |  18 +
 src/rebar/inttest/rgen1/test.config             |   1 +
 src/rebar/inttest/rgen1/vars.config             |   1 +
 src/rebar/inttest/t_custom_config/custom.config |   4 +
 .../inttest/t_custom_config/custom_config.erl   |   6 +
 .../t_custom_config/t_custom_config_rt.erl      |  39 +
 src/rebar/inttest/tdeps1/a.erl                  |   8 +
 src/rebar/inttest/tdeps1/a.rebar.config         |   1 +
 src/rebar/inttest/tdeps1/b.hrl                  |   1 +
 src/rebar/inttest/tdeps1/b.rebar.config         |   1 +
 src/rebar/inttest/tdeps1/c.hrl                  |   1 +
 src/rebar/inttest/tdeps1/tdeps1_rt.erl          |  59 ++
 src/rebar/inttest/tdeps2/a.erl                  |   3 +
 src/rebar/inttest/tdeps2/a.rebar.config         |   1 +
 src/rebar/inttest/tdeps2/b.hrl                  |   1 +
 src/rebar/inttest/tdeps2/b.rebar.config         |   1 +
 src/rebar/inttest/tdeps2/c.hrl                  |   1 +
 src/rebar/inttest/tdeps2/root.rebar.config      |   2 +
 src/rebar/inttest/tdeps2/tdeps2_rt.erl          |  65 ++
 src/rebar/inttest/tdeps3/a.erl                  |   3 +
 src/rebar/inttest/tdeps3/a.rebar.config         |   4 +
 src/rebar/inttest/tdeps3/b.hrl                  |   1 +
 src/rebar/inttest/tdeps3/b.rebar.config         |   5 +
 src/rebar/inttest/tdeps3/c.hrl                  |   1 +
 src/rebar/inttest/tdeps3/c.rebar.config         |   1 +
 src/rebar/inttest/tdeps3/d.hrl                  |   1 +
 src/rebar/inttest/tdeps3/d.rebar.config         |   1 +
 src/rebar/inttest/tdeps3/e.hrl                  |   1 +
 src/rebar/inttest/tdeps3/f.hrl                  |   1 +
 src/rebar/inttest/tdeps3/root.rebar.config      |   1 +
 src/rebar/inttest/tdeps3/tdeps3_rt.erl          |  89 ++
 src/rebar/inttest/tdeps_update/a.erl            |   3 +
 src/rebar/inttest/tdeps_update/a.rebar.config   |   1 +
 src/rebar/inttest/tdeps_update/a2.rebar.config  |   1 +
 src/rebar/inttest/tdeps_update/a3.rebar.config  |   1 +
 src/rebar/inttest/tdeps_update/a4.rebar.config  |   4 +
 src/rebar/inttest/tdeps_update/b.hrl            |   1 +
 src/rebar/inttest/tdeps_update/b.rebar.config   |   1 +
 src/rebar/inttest/tdeps_update/b2.rebar.config  |   1 +
 src/rebar/inttest/tdeps_update/b3.rebar.config  |   1 +
 src/rebar/inttest/tdeps_update/b4.rebar.config  |   1 +
 src/rebar/inttest/tdeps_update/c.hrl            |   1 +
 src/rebar/inttest/tdeps_update/c.rebar.config   |   1 +
 src/rebar/inttest/tdeps_update/c2.hrl           |   1 +
 src/rebar/inttest/tdeps_update/c2.rebar.config  |   4 +
 src/rebar/inttest/tdeps_update/c3.rebar.config  |   4 +
 src/rebar/inttest/tdeps_update/d.hrl            |   1 +
 .../inttest/tdeps_update/root.rebar.config      |   1 +
 .../inttest/tdeps_update/tdeps_update_rt.erl    | 147 ++++
 src/rebar/inttest/thooks/fish.erl               |   5 +
 src/rebar/inttest/thooks/rebar.config           |   7 +
 src/rebar/inttest/thooks/thooks_rt.erl          |  40 +
 src/rebar/inttest/tplugins/bad.config           |   2 +
 src/rebar/inttest/tplugins/bad_plugin.erl       |   7 +
 src/rebar/inttest/tplugins/fish.erl             |   5 +
 src/rebar/inttest/tplugins/rebar.config         |   1 +
 src/rebar/inttest/tplugins/test_plugin.erl      |   8 +
 src/rebar/inttest/tplugins/tplugins_rt.erl      |  40 +
 src/rebar/priv/shell-completion/bash/rebar      |  85 ++
 src/rebar/priv/shell-completion/zsh/_rebar      |  83 ++
 src/rebar/priv/templates/basicnif.c             |  59 ++
 src/rebar/priv/templates/basicnif.erl           |  42 +
 src/rebar/priv/templates/basicnif.template      |   3 +
 src/rebar/priv/templates/ctsuite.erl            | 167 ++++
 src/rebar/priv/templates/ctsuite.template       |   2 +
 src/rebar/priv/templates/simpleapp.app.src      |  12 +
 src/rebar/priv/templates/simpleapp.template     |   4 +
 src/rebar/priv/templates/simpleapp_app.erl      |  16 +
 src/rebar/priv/templates/simpleapp_sup.erl      |  27 +
 src/rebar/priv/templates/simplefsm.erl          |  57 ++
 src/rebar/priv/templates/simplefsm.template     |   2 +
 src/rebar/priv/templates/simplemod.erl          |   6 +
 src/rebar/priv/templates/simplemod.template     |   3 +
 src/rebar/priv/templates/simplemod_tests.erl    |   3 +
 src/rebar/priv/templates/simplenode.erl.script  |  44 +
 .../simplenode.install_upgrade.escript          |  44 +
 src/rebar/priv/templates/simplenode.nodetool    | 182 ++++
 .../priv/templates/simplenode.reltool.config    |  44 +
 src/rebar/priv/templates/simplenode.runner      | 348 ++++++++
 src/rebar/priv/templates/simplenode.sys.config  |  11 +
 src/rebar/priv/templates/simplenode.template    |  13 +
 src/rebar/priv/templates/simplenode.vm.args     |  19 +
 .../templates/simplenode.windows.runner.cmd     | 103 +++
 .../templates/simplenode.windows.start_erl.cmd  |  40 +
 src/rebar/priv/templates/simplesrv.erl          |  50 ++
 src/rebar/priv/templates/simplesrv.template     |   2 +
 src/rebar/rebar.config                          |  21 +
 src/rebar/rebar.config.sample                   | 236 ++++++
 src/rebar/rebar.config.script                   |  20 +
 src/rebar/src/getopt.erl                        | 842 +++++++++++++++++++
 src/rebar/src/mustache.erl                      | 228 +++++
 src/rebar/src/rebar.erl                         | 501 +++++++++++
 src/rebar/src/rebar_abnfc_compiler.erl          | 123 +++
 src/rebar/src/rebar_app_utils.erl               | 208 +++++
 src/rebar/src/rebar_appups.erl                  | 210 +++++
 src/rebar/src/rebar_asn1_compiler.erl           | 100 +++
 src/rebar/src/rebar_base_compiler.erl           | 260 ++++++
 src/rebar/src/rebar_cleaner.erl                 |  56 ++
 src/rebar/src/rebar_config.erl                  | 249 ++++++
 src/rebar/src/rebar_core.erl                    | 608 +++++++++++++
 src/rebar/src/rebar_ct.erl                      | 350 ++++++++
 src/rebar/src/rebar_deps.erl                    | 774 +++++++++++++++++
 src/rebar/src/rebar_dia_compiler.erl            | 106 +++
 src/rebar/src/rebar_edoc.erl                    | 130 +++
 src/rebar/src/rebar_erlc_compiler.erl           | 511 +++++++++++
 src/rebar/src/rebar_erlydtl_compiler.erl        | 265 ++++++
 src/rebar/src/rebar_escripter.erl               | 197 +++++
 src/rebar/src/rebar_eunit.erl                   | 812 ++++++++++++++++++
 src/rebar/src/rebar_file_utils.erl              | 194 +++++
 src/rebar/src/rebar_lfe_compiler.erl            |  84 ++
 src/rebar/src/rebar_log.erl                     |  83 ++
 src/rebar/src/rebar_neotoma_compiler.erl        | 163 ++++
 src/rebar/src/rebar_otp_app.erl                 | 220 +++++
 src/rebar/src/rebar_port_compiler.erl           | 607 +++++++++++++
 src/rebar/src/rebar_protobuffs_compiler.erl     | 153 ++++
 src/rebar/src/rebar_qc.erl                      | 187 ++++
 src/rebar/src/rebar_rel_utils.erl               | 238 ++++++
 src/rebar/src/rebar_reltool.erl                 | 408 +++++++++
 src/rebar/src/rebar_require_vsn.erl             | 121 +++
 src/rebar/src/rebar_shell.erl                   |  56 ++
 src/rebar/src/rebar_subdirs.erl                 |  84 ++
 src/rebar/src/rebar_templater.erl               | 462 ++++++++++
 src/rebar/src/rebar_upgrade.erl                 | 268 ++++++
 src/rebar/src/rebar_utils.erl                   | 510 +++++++++++
 src/rebar/src/rebar_xref.erl                    | 287 +++++++
 src/rebar/test/rebar_eunit_tests.erl            | 434 ++++++++++
 src/rebar/test/rebar_file_utils_tests.erl       | 278 ++++++
 src/rebar/test/rebar_xref_eunit.erl             | 203 +++++
 src/rebar/test/upgrade_project/README.md        |  40 +
 .../apps/dummy/src/dummy.app.src                |   9 +
 .../apps/dummy/src/dummy_app.erl                |   9 +
 .../apps/dummy/src/dummy_server.erl             |  56 ++
 .../apps/dummy/src/dummy_sup.erl                |  15 +
 src/rebar/test/upgrade_project/rebar.config     |   4 +
 src/rebar/test/upgrade_project/rel/files/dummy  | 347 ++++++++
 src/rebar/test/upgrade_project/rel/files/erl    |  44 +
 .../test/upgrade_project/rel/files/nodetool     | 182 ++++
 .../test/upgrade_project/rel/files/sys.config   |  11 +
 .../test/upgrade_project/rel/files/vm.args      |  19 +
 .../test/upgrade_project/rel/reltool.config     |  27 +
 166 files changed, 15686 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/626455a4/src/rebar/.gitignore
----------------------------------------------------------------------
diff --git a/src/rebar/.gitignore b/src/rebar/.gitignore
new file mode 100644
index 0000000..ef672fe
--- /dev/null
+++ b/src/rebar/.gitignore
@@ -0,0 +1,12 @@
+*.beam
+rebar
+*~
+*.orig
+.*.swp
+rt.work
+.hgignore
+.test
+dialyzer_warnings
+rebar.cmd
+.eunit
+deps

http://git-wip-us.apache.org/repos/asf/couchdb/blob/626455a4/src/rebar/.travis.yml
----------------------------------------------------------------------
diff --git a/src/rebar/.travis.yml b/src/rebar/.travis.yml
new file mode 100644
index 0000000..191d337
--- /dev/null
+++ b/src/rebar/.travis.yml
@@ -0,0 +1,8 @@
+language: erlang
+otp_release:
+  - R16B
+  - R15B01
+  - R15B
+  - R14B04
+  - R14B03
+script: "make travis"

http://git-wip-us.apache.org/repos/asf/couchdb/blob/626455a4/src/rebar/CONTRIBUTING.md
----------------------------------------------------------------------
diff --git a/src/rebar/CONTRIBUTING.md b/src/rebar/CONTRIBUTING.md
new file mode 100644
index 0000000..30693d8
--- /dev/null
+++ b/src/rebar/CONTRIBUTING.md
@@ -0,0 +1,94 @@
+Contributing to rebar
+---------------------
+
+Before implementing a new feature, please submit a ticket to discuss your plans.  
+The feature might have been rejected already, or the implementation might already be decided.
+
+See [Community and Resources](README.md#community-and-resources).
+
+Code style
+----------
+
+The following rules must be followed:
+ * Do not introduce trailing whitespace
+ * Do not mix spaces and tabs
+ * Do not introduce lines longer than 80 characters
+
+The following rules should be followed:
+ * Write small functions whenever possible
+ * Avoid having too many clauses containing clauses containing clauses.  
+   Basically, avoid deeply nested functions.
+
+[erlang-mode (emacs)](http://www.erlang.org/doc/man/erlang.el.html)
+indentation is preferred. This will keep the code base consistent.  
+vi users are encouraged to give [Vim emulation](http://emacswiki.org/emacs/Evil) ([more
+info](https://gitorious.org/evil/pages/Home)) a try.
+
+Pull requests and branching
+---------------------------
+
+Use one topic branch per pull request. If you do that, you can add extra commits or fix up  
+buggy commits via `git rebase -i`, and update the branch. The updated branch will be  
+visible in the same pull request. Therefore, you should not open a new pull request when  
+you have to fix your changes.
+
+Do not commit to master in your fork.
+
+Provide a clean branch without merge commits.
+
+Committing your changes
+-----------------------
+
+Please ensure that all commits pass all tests, and do not have extra Dialyzer warnings.  
+To do that run `make check`. If you didn't build via `make debug` at first, the beam files in  
+`ebin/` might be missing debug_info required for [xref](http://www.erlang.org/doc/man/xref.html) 
+and [Dialyzer](http://www.erlang.org/doc/man/dialyzer.html), causing a test 
+failure.  
+If that happens, running `make clean` before running `make check` could solve the problem.  
+If you change any of the files with known but safe to ignore Dialyzer warnings, you may  
+have to adapt the line number(s) in [dialyzer_reference](dialyzer_reference). If you do that, 
+do not remove the  
+leading blank line.
+
+#### Structuring your commits
+
+Fixing a bug is one commit.  
+Adding a feature is one commit.  
+Adding two features is two commits.  
+Two unrelated changes is two commits.
+
+If you fix a (buggy) commit, squash (`git rebase -i`) the changes as a fixup commit into  
+the original commit.
+
+#### Writing Commit Messages
+
+It's important to write a proper commit title and description. The commit title must be  
+at most 50 characters; it is the first line of the commit text. The second line of the  
+commit text must be left blank. The third line and beyond is the commit message. You  
+should write a commit message. If you do, wrap all lines at 72 characters. You should  
+explain what the commit does, what references you used, and any other information  
+that helps understanding your changes.
+
+Basically, structure your commit message like this:
+
+<pre>
+One line summary (at most 50 characters)
+
+Longer description (wrap at 72 characters)
+</pre>
+
+##### Commit title/summary
+
+* At most 50 characters
+* What was changed
+* Imperative present tense (Fix, Add, Change)
+ * `Fix bug 123`
+ * `Add 'foobar' command`
+ * `Change default timeout to 123`
+* No period
+
+##### Commit description
+
+* Wrap at 72 characters
+* Why, explain intention and implementation approach
+* Present tense

http://git-wip-us.apache.org/repos/asf/couchdb/blob/626455a4/src/rebar/LICENSE
----------------------------------------------------------------------
diff --git a/src/rebar/LICENSE b/src/rebar/LICENSE
new file mode 100644
index 0000000..e454a52
--- /dev/null
+++ b/src/rebar/LICENSE
@@ -0,0 +1,178 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+

http://git-wip-us.apache.org/repos/asf/couchdb/blob/626455a4/src/rebar/Makefile
----------------------------------------------------------------------
diff --git a/src/rebar/Makefile b/src/rebar/Makefile
new file mode 100644
index 0000000..1aeb6ad
--- /dev/null
+++ b/src/rebar/Makefile
@@ -0,0 +1,44 @@
+.PHONY: clean dialyzer_warnings xref_warnings deps test
+
+REBAR=$(PWD)/rebar
+RETEST=$(PWD)/deps/retest/retest
+
+all:
+	./bootstrap
+
+clean:
+	@rm -rf rebar ebin/*.beam inttest/rt.work rt.work .eunit
+
+distclean: clean
+	@rm -f dialyzer_warnings
+	@rm -rf deps
+
+debug:
+	@./bootstrap debug
+
+check: debug xref dialyzer deps test
+
+xref:
+	@./rebar xref
+
+dialyzer: dialyzer_warnings
+	@diff -U0 dialyzer_reference dialyzer_warnings
+
+dialyzer_warnings:
+	-@dialyzer -q -nn -n ebin -Wunmatched_returns -Werror_handling \
+		-Wrace_conditions > dialyzer_warnings
+
+binary: VSN = $(shell ./rebar -V)
+binary: clean all
+	@cp rebar ../rebar.wiki/rebar
+	(cd ../rebar.wiki && git commit -m "Update $(VSN)" rebar)
+
+deps:
+	@REBAR_EXTRA_DEPS=1 ./rebar get-deps
+	@(cd deps/retest && $(REBAR) compile escriptize)
+
+test:
+	@$(REBAR) eunit
+	@$(RETEST) -v inttest
+
+travis: clean debug xref clean all deps test

http://git-wip-us.apache.org/repos/asf/couchdb/blob/626455a4/src/rebar/NOTES.org
----------------------------------------------------------------------
diff --git a/src/rebar/NOTES.org b/src/rebar/NOTES.org
new file mode 100644
index 0000000..798cf4d
--- /dev/null
+++ b/src/rebar/NOTES.org
@@ -0,0 +1,28 @@
+
+* Major operations
+** Compile
+*** Code generation
+*** Compilation/linking
+*** App validation
+** Clean
+** ct testing
+** eunit testing
+** Installation
+** Doc generation
+
+* Modes/File types
+** Erlang 
+** Port driver
+** NIF driver
+** SNMP MIBs
+** ASN.1 files
+
+* Misc. Notes
+** Port/NIF driver compilation needs pre/post hook
+** Need to support code generation for things like protobuf
+** Need to support compilation flags
+
+* Contexts
+** Application
+** General
+** Release ?!

http://git-wip-us.apache.org/repos/asf/couchdb/blob/626455a4/src/rebar/README.md
----------------------------------------------------------------------
diff --git a/src/rebar/README.md b/src/rebar/README.md
new file mode 100644
index 0000000..3ec4a3a
--- /dev/null
+++ b/src/rebar/README.md
@@ -0,0 +1,79 @@
+rebar
+=====
+
+rebar is an Erlang build tool that makes it easy to compile and test Erlang
+applications, port drivers and releases.
+
+[![Build Status](https://secure.travis-ci.org/rebar/rebar.png?branch=master)](http://travis-ci.org/rebar/rebar)
+
+rebar is a self-contained Erlang script, so it's easy to distribute or even
+embed directly in a project. Where possible, rebar uses standard Erlang/OTP
+conventions for project structures, thus minimizing the amount of build
+configuration work. rebar also provides dependency management, enabling
+application writers to easily re-use common libraries from a variety of
+locations (git, hg, etc).
+
+Building
+--------
+
+Information on building and installing [Erlang/OTP](http://www.erlang.org) can
+be found [here](https://github.com/erlang/otp/wiki/Installation) ([more
+info](https://github.com/erlang/otp/blob/master/INSTALL.md)).
+
+### Dependencies
+
+To build rebar you will need a working installation of Erlang R13B03 (or later).
+
+Should you want to clone the rebar repository, you will also require git.
+
+#### Downloading
+
+You can download a pre-built binary version of rebar from:
+
+https://github.com/rebar/rebar/wiki/rebar
+
+#### Building rebar
+
+```sh
+$ git clone git://github.com/rebar/rebar.git
+$ cd rebar
+$ ./bootstrap
+Recompile: src/getopt
+...
+Recompile: src/rebar_utils
+==> rebar (compile)
+Congratulations! You now have a self-contained script called "rebar" in
+your current working directory. Place this script anywhere in your path
+and you can use rebar to build OTP-compliant apps.
+```
+
+
+Contributing to rebar
+=====================
+
+Please refer to [CONTRIBUTING](CONTRIBUTING.md).
+
+Community and Resources
+-----------------------
+
+In case of problems that cannot be solved through documentation or examples, you
+may want to try to contact members of the community for help. The community is
+also where you want to go for questions about how to extend rebar, fill in bug
+reports, and so on.
+
+The main place to go for questions is the [rebar mailing
+list](http://lists.basho.com/pipermail/rebar_lists.basho.com/). If you need
+quick feedback, you can try the #rebar channel on
+[irc.freenode.net](http://freenode.net). Be sure to check the
+[wiki](https://github.com/rebar/rebar/wiki) first, just to be sure you're not
+asking about things with well known answers.
+
+For bug reports, roadmaps, and issues, visit the [github issues
+page](https://github.com/rebar/rebar/issues).
+
+General rebar community resources and links:
+
+- [Rebar Mailing List](http://lists.basho.com/pipermail/rebar_lists.basho.com/)
+- #rebar on [irc.freenode.net](http://freenode.net/)
+- [wiki](https://github.com/rebar/rebar/wiki)
+- [issues](https://github.com/rebar/rebar/issues)

http://git-wip-us.apache.org/repos/asf/couchdb/blob/626455a4/src/rebar/THANKS
----------------------------------------------------------------------
diff --git a/src/rebar/THANKS b/src/rebar/THANKS
new file mode 100644
index 0000000..95cc493
--- /dev/null
+++ b/src/rebar/THANKS
@@ -0,0 +1,122 @@
+The following people have contributed to rebar:
+
+Dave Smith
+Jon Meredith
+Tim Dysinger
+Bryan Fink
+Tuncer Ayaz
+Ian Wilkinson
+Juan Jose Comellas
+Tom Preston-Werner
+OJ Reeves
+Ruslan Babayev
+Ryan Tilder
+Kevin Smith
+David Reid
+Cliff Moon
+Chris Bernard
+Jeremy Raymond
+Bob Ippolito
+Alex Songe
+Andrew Thompson
+Russell Brown
+Chris Chew
+Klas Johansson
+Geoff Cant
+Kostis Sagonas
+Essien Ita Essien
+Manuel Duran Aguete
+Daniel Neri
+Misha Gorodnitzky
+Adam Kocoloski
+Joseph Wayne Norton
+Mihai Balea
+Matthew Batema
+Alexey Romanov
+Benjamin Nortier
+Magnus Klaar
+Anthony Ramine
+Charles McKnight
+Andrew Tunnell-Jones
+Joe Williams
+Daniel Reverri
+Jesper Louis Andersen
+Richard Jones
+Tim Watson
+Anders 'andekar'
+Christopher Brown
+Jordi Chacon
+Shunichi Shinohara
+Mickael Remond
+Evax Software
+Piotr Usewicz
+Anthony Molinaro
+Andrew Gopienko
+Steve Vinoski
+Evan Miller
+Jared Morrow
+Jan Kloetzke
+Mathias Meyer
+Steven Gravell
+Alexis Sellier
+Mattias Holmlund
+Tino Breddin
+David Nonnenmacher
+Anders Nygren
+Scott Lystig Fritchie
+Uwe Dauernheim
+Yurii Rashkovskii
+Alfonso De Gregorio
+Matt Campbell
+Benjamin Plee
+Ben Ellis
+Ignas Vysniauskas
+Anton Lavrik
+Jan Vincent Liwanag
+Przemyslaw Dabek
+Fabian Linzberger
+Smith Winston
+Jesse Gumm
+Torbjorn Tornkvist
+Ali Sabil
+Tomas Abrahamsson
+Francis Joanis
+fisher@yun.io
+Slava Yurin
+Phillip Toland
+Mike Lazar
+Loic Hoguin
+Ali Yakout
+Adam Schepis
+Amit Kapoor
+Ulf Wiger
+Nick Vatamaniuc
+Daniel Luna
+Motiejus Jakstys
+Eric B Merritt
+Fred Hebert
+Kresten Krab Thorup
+David Aaberg
+Pedram Nimreezi
+Edwin Fine
+Lev Walkin
+Roberto Ostinelli
+Joe DeVivo
+Markus Nasman
+Dmitriy Kargapolov
+Ryan Zezeski
+Daniel White
+Martin Schut
+Serge Aleynikov
+Magnus Henoch
+Artem Teslenko
+Jeremie Lasalle Ratelle
+Jose Valim
+Krzysztof Rutka
+Mats Cronqvist
+Matthew Conway
+Giacomo Olgeni
+Pedram Nimreezi
+Sylvain Benner
+Oliver Ferrigni
+Dave Thomas

http://git-wip-us.apache.org/repos/asf/couchdb/blob/626455a4/src/rebar/bootstrap
----------------------------------------------------------------------
diff --git a/src/rebar/bootstrap b/src/rebar/bootstrap
new file mode 100755
index 0000000..70d8da1
--- /dev/null
+++ b/src/rebar/bootstrap
@@ -0,0 +1,118 @@
+#!/usr/bin/env escript
+%% -*- mode: erlang;erlang-indent-level: 4;indent-tabs-mode: nil -*-
+%% ex: ft=erlang ts=4 sw=4 et
+
+main(Args) ->
+    %% Get a string repr of build time
+    Built = build_time(),
+
+    %% Get a string repr of first matching VCS changeset
+    VcsInfo = vcs_info([{hg, ".hg", "hg identify -i", "hg status"},
+                        {git, ".git", "git describe --always --tags",
+                         "git status -s"}]),
+
+    %% Check for force=1 flag to force a rebuild
+    case lists:member("force=1", Args) of
+        true ->
+            rm("ebin/*.beam");
+        false ->
+            rm("ebin/rebar.beam")
+    end,
+
+    %% Add check for debug flag
+    DebugFlag = case lists:member("debug", Args) of
+                    true -> debug_info;
+                    false -> undefined
+                end,
+
+    %% Extract the system info of the version of OTP we use to compile rebar
+    OtpInfo = string:strip(erlang:system_info(otp_release), both, $\n),
+
+    %% Compile all src/*.erl to ebin
+    case make:files(filelib:wildcard("src/*.erl"),
+                    [{outdir, "ebin"}, {i, "include"},
+                     DebugFlag,
+                     {d, 'BUILD_TIME', Built},
+                     {d, 'VCS_INFO', VcsInfo},
+                     {d, 'OTP_INFO', OtpInfo}]) of
+        up_to_date ->
+            ok;
+        error ->
+            io:format("Failed to compile rebar files!\n"),
+            halt(1)
+    end,
+
+    %% Make sure file:consult can parse the .app file
+    case file:consult("ebin/rebar.app") of
+        {ok, _} ->
+            ok;
+        {error, Reason} ->
+            io:format("Invalid syntax in ebin/rebar.app: ~p\n", [Reason]),
+            halt(1)
+    end,
+
+    %% Add ebin/ to our path
+    true = code:add_path("ebin"),
+
+    %% Run rebar compile to do proper .app validation etc.
+    %% and rebar escriptize to create the rebar script
+    rebar:main(["compile", "escriptize"] ++ Args),
+
+    %% Finally, update executable perms for our script on *nix,
+    %%  or write out script files on win32.
+    case os:type() of
+        {unix,_} ->
+            [] = os:cmd("chmod u+x rebar"),
+            ok;
+        {win32,_} ->
+            write_windows_scripts(),
+            ok;
+        _ ->
+            ok
+    end,
+
+    %% Add a helpful message
+    io:format("Congratulations! You now have a self-contained script called"
+              " \"rebar\" in\n"
+              "your current working directory. "
+              "Place this script anywhere in your path\n"
+              "and you can use rebar to build OTP-compliant apps.\n").
+
+rm(Path) ->
+    NativePath = filename:nativename(Path),
+    Cmd = case os:type() of
+              {unix,_} -> "rm -f ";
+              {win32,_} -> "del /q "
+          end,
+    [] = os:cmd(Cmd ++ NativePath),
+    ok.
+
+build_time() ->
+    {{Y, M, D}, {H, Min, S}} = calendar:now_to_universal_time(now()),
+    lists:flatten(io_lib:format("~4..0w~2..0w~2..0w_~2..0w~2..0w~2..0w",
+                                [Y, M, D, H, Min, S])).
+
+vcs_info([]) ->
+    "No VCS info available.";
+vcs_info([{Id, Dir, VsnCmd, StatusCmd} | Rest]) ->
+    case filelib:is_dir(Dir) of
+        true ->
+            Vsn = string:strip(os:cmd(VsnCmd), both, $\n),
+            Status = case string:strip(os:cmd(StatusCmd), both, $\n) of
+                         [] ->
+                             "";
+                         _ ->
+                             "-dirty"
+                     end,
+            lists:concat([Id, " ", Vsn, Status]);
+        false ->
+            vcs_info(Rest)
+    end.
+
+write_windows_scripts() ->
+    CmdScript=
+        "@echo off\r\n"
+        "setlocal\r\n"
+        "set rebarscript=%~f0\r\n"
+        "escript.exe \"%rebarscript:.cmd=%\" %*\r\n",
+    ok = file:write_file("rebar.cmd", CmdScript).

http://git-wip-us.apache.org/repos/asf/couchdb/blob/626455a4/src/rebar/bootstrap.bat
----------------------------------------------------------------------
diff --git a/src/rebar/bootstrap.bat b/src/rebar/bootstrap.bat
new file mode 100644
index 0000000..b646a7d
--- /dev/null
+++ b/src/rebar/bootstrap.bat
@@ -0,0 +1,2 @@
+@echo off
+escript.exe bootstrap %*

http://git-wip-us.apache.org/repos/asf/couchdb/blob/626455a4/src/rebar/dialyzer_reference
----------------------------------------------------------------------
diff --git a/src/rebar/dialyzer_reference b/src/rebar/dialyzer_reference
new file mode 100644
index 0000000..e26d8dd
--- /dev/null
+++ b/src/rebar/dialyzer_reference
@@ -0,0 +1,3 @@
+
+rebar_eunit.erl:388: Call to missing or unexported function eunit_test:function_wrapper/2
+rebar_utils.erl:163: Call to missing or unexported function escript:foldl/3

http://git-wip-us.apache.org/repos/asf/couchdb/blob/626455a4/src/rebar/ebin/rebar.app
----------------------------------------------------------------------
diff --git a/src/rebar/ebin/rebar.app b/src/rebar/ebin/rebar.app
new file mode 100644
index 0000000..e64a51f
--- /dev/null
+++ b/src/rebar/ebin/rebar.app
@@ -0,0 +1,93 @@
+%% -*- mode: erlang;erlang-indent-level: 4;indent-tabs-mode: nil -*-
+%% ex: ts=4 sw=4 ft=erlang et
+
+{application, rebar,
+ [{description, "Rebar: Erlang Build Tool"},
+  {vsn, "2.1.0"},
+  {modules, [ rebar,
+              rebar_abnfc_compiler,
+              rebar_app_utils,
+              rebar_appups,
+              rebar_asn1_compiler,
+              rebar_dia_compiler,
+              rebar_base_compiler,
+              rebar_cleaner,
+              rebar_config,
+              rebar_core,
+              rebar_ct,
+              rebar_deps,
+              rebar_edoc,
+              rebar_erlc_compiler,
+              rebar_erlydtl_compiler,
+              rebar_escripter,
+              rebar_eunit,
+              rebar_file_utils,
+              rebar_lfe_compiler,
+              rebar_log,
+              rebar_neotoma_compiler,
+              rebar_otp_app,
+              rebar_port_compiler,
+              rebar_protobuffs_compiler,
+              rebar_qc,
+              rebar_rel_utils,
+              rebar_reltool,
+              rebar_require_vsn,
+              rebar_shell,
+              rebar_subdirs,
+              rebar_templater,
+              rebar_upgrade,
+              rebar_utils,
+              rebar_xref,
+              getopt,
+              mustache ]},
+  {registered, []},
+  {applications, [kernel,
+                  stdlib,
+                  sasl,
+                  compiler,
+                  crypto,
+                  syntax_tools,
+                  tools]},
+  {env, [
+         %% Default log level
+         {log_level, error},
+
+         %% any_dir processing modules
+         {any_dir_modules, [
+                            rebar_require_vsn,
+                            rebar_deps,
+                            rebar_subdirs,
+                            rebar_templater,
+                            rebar_cleaner
+                           ]},
+
+         %% Dir specific processing modules
+         {modules, [
+                    {app_dir, [
+                               rebar_abnfc_compiler,
+                               rebar_protobuffs_compiler,
+                               rebar_neotoma_compiler,
+                               rebar_asn1_compiler,
+                               rebar_dia_compiler,
+                               rebar_erlc_compiler,
+                               rebar_lfe_compiler,
+                               rebar_erlydtl_compiler,
+                               rebar_port_compiler,
+                               rebar_otp_app,
+                               rebar_ct,
+                               rebar_eunit,
+                               rebar_qc,
+                               rebar_escripter,
+                               rebar_edoc,
+                               rebar_shell,
+                               rebar_xref
+                              ]},
+
+                    {rel_dir, [
+                               rebar_appups,
+                               rebar_reltool,
+                               rebar_upgrade
+                              ]}
+                   ]}
+        ]}
+ ]}.

http://git-wip-us.apache.org/repos/asf/couchdb/blob/626455a4/src/rebar/include/rebar.hrl
----------------------------------------------------------------------
diff --git a/src/rebar/include/rebar.hrl b/src/rebar/include/rebar.hrl
new file mode 100644
index 0000000..58debfc
--- /dev/null
+++ b/src/rebar/include/rebar.hrl
@@ -0,0 +1,14 @@
+%% TODO: rename FAIL to ABORT once we require at least R13B04 for
+%% building rebar. Macros with different arity were not supported by the
+%% compiler before 13B04.
+-define(FAIL, rebar_utils:abort()).
+-define(ABORT(Str, Args), rebar_utils:abort(Str, Args)).
+
+-define(CONSOLE(Str, Args), io:format(Str, Args)).
+
+-define(DEBUG(Str, Args), rebar_log:log(debug, Str, Args)).
+-define(INFO(Str, Args), rebar_log:log(info, Str, Args)).
+-define(WARN(Str, Args), rebar_log:log(warn, Str, Args)).
+-define(ERROR(Str, Args), rebar_log:log(error, Str, Args)).
+
+-define(FMT(Str, Args), lists:flatten(io_lib:format(Str, Args))).

http://git-wip-us.apache.org/repos/asf/couchdb/blob/626455a4/src/rebar/inttest/bug_5_rt.erl
----------------------------------------------------------------------
diff --git a/src/rebar/inttest/bug_5_rt.erl b/src/rebar/inttest/bug_5_rt.erl
new file mode 100644
index 0000000..a06b693
--- /dev/null
+++ b/src/rebar/inttest/bug_5_rt.erl
@@ -0,0 +1,29 @@
+-module(bug_5_rt).
+
+-compile(export_all).
+
+
+files() ->
+    [{create, "ebin/a1.app", app(a1)},
+     {create, "deps/d1/src/d1.app.src", app(d1)},
+     {create, "rebar.config",
+      <<"{deps, [{d1, \"1\", {hg, \"http://example.com\", \"tip\"}}]}.\n">>},
+     {copy, "../rebar", "rebar"}].
+
+run(_Dir) ->
+    {ok, _} = retest:sh("./rebar compile"),
+    ok.
+
+
+
+%%
+%% Generate the contents of a simple .app file
+%%
+app(Name) ->
+    App = {application, Name,
+           [{description, atom_to_list(Name)},
+            {vsn, "1"},
+            {modules, []},
+            {registered, []},
+            {applications, [kernel, stdlib]}]},
+    io_lib:format("~p.\n", [App]).

http://git-wip-us.apache.org/repos/asf/couchdb/blob/626455a4/src/rebar/inttest/ct1/ct1_rt.erl
----------------------------------------------------------------------
diff --git a/src/rebar/inttest/ct1/ct1_rt.erl b/src/rebar/inttest/ct1/ct1_rt.erl
new file mode 100644
index 0000000..f173d3f
--- /dev/null
+++ b/src/rebar/inttest/ct1/ct1_rt.erl
@@ -0,0 +1,28 @@
+-module(ct1_rt).
+
+-compile(export_all).
+
+
+files() ->
+    [{create, "ebin/a1.app", app(a1)},
+     {copy, "../../rebar", "rebar"},
+     {copy, "rebar.config", "rebar.config"},
+     {copy, "test_SUITE.erl", "itest/test_SUITE.erl"}].
+
+run(_Dir) ->
+    {ok, _} = retest:sh("./rebar compile ct"),
+    ok.
+
+
+
+%%
+%% Generate the contents of a simple .app file
+%%
+app(Name) ->
+    App = {application, Name,
+           [{description, atom_to_list(Name)},
+            {vsn, "1"},
+            {modules, []},
+            {registered, []},
+            {applications, [kernel, stdlib]}]},
+    io_lib:format("~p.\n", [App]).

http://git-wip-us.apache.org/repos/asf/couchdb/blob/626455a4/src/rebar/inttest/ct1/rebar.config
----------------------------------------------------------------------
diff --git a/src/rebar/inttest/ct1/rebar.config b/src/rebar/inttest/ct1/rebar.config
new file mode 100644
index 0000000..a4b5284
--- /dev/null
+++ b/src/rebar/inttest/ct1/rebar.config
@@ -0,0 +1 @@
+{ct_dir, "itest"}.

http://git-wip-us.apache.org/repos/asf/couchdb/blob/626455a4/src/rebar/inttest/ct1/test_SUITE.erl
----------------------------------------------------------------------
diff --git a/src/rebar/inttest/ct1/test_SUITE.erl b/src/rebar/inttest/ct1/test_SUITE.erl
new file mode 100644
index 0000000..92f2b2e
--- /dev/null
+++ b/src/rebar/inttest/ct1/test_SUITE.erl
@@ -0,0 +1,11 @@
+-module(test_SUITE).
+
+-compile(export_all).
+
+-include_lib("ct.hrl").
+
+all() ->
+    [simple_test].
+
+simple_test(Config) ->
+    io:format("Test: ~p\n", [Config]).

http://git-wip-us.apache.org/repos/asf/couchdb/blob/626455a4/src/rebar/inttest/ct2/ct2_rt.erl
----------------------------------------------------------------------
diff --git a/src/rebar/inttest/ct2/ct2_rt.erl b/src/rebar/inttest/ct2/ct2_rt.erl
new file mode 100644
index 0000000..ecab0e4
--- /dev/null
+++ b/src/rebar/inttest/ct2/ct2_rt.erl
@@ -0,0 +1,26 @@
+-module(ct2_rt).
+
+-compile(export_all).
+
+
+files() ->
+    [{create, "ebin/foo.app", app(foo)},
+     {copy, "../../rebar", "rebar"},
+     {copy, "foo.test.spec", "foo.test.spec"},
+     {copy, "foo_SUITE.erl", "test/foo_SUITE.erl"}].
+
+run(_Dir) ->
+    {ok, _} = retest:sh("./rebar compile ct -vvv"),
+    ok.
+
+%%
+%% Generate the contents of a simple .app file
+%%
+app(Name) ->
+    App = {application, Name,
+           [{description, atom_to_list(Name)},
+            {vsn, "1"},
+            {modules, []},
+            {registered, []},
+            {applications, [kernel, stdlib]}]},
+    io_lib:format("~p.\n", [App]).

http://git-wip-us.apache.org/repos/asf/couchdb/blob/626455a4/src/rebar/inttest/ct2/foo.test.spec
----------------------------------------------------------------------
diff --git a/src/rebar/inttest/ct2/foo.test.spec b/src/rebar/inttest/ct2/foo.test.spec
new file mode 100644
index 0000000..f3e4cb0
--- /dev/null
+++ b/src/rebar/inttest/ct2/foo.test.spec
@@ -0,0 +1 @@
+{suites, "test", all}.

http://git-wip-us.apache.org/repos/asf/couchdb/blob/626455a4/src/rebar/inttest/ct2/foo_SUITE.erl
----------------------------------------------------------------------
diff --git a/src/rebar/inttest/ct2/foo_SUITE.erl b/src/rebar/inttest/ct2/foo_SUITE.erl
new file mode 100644
index 0000000..d03aedf
--- /dev/null
+++ b/src/rebar/inttest/ct2/foo_SUITE.erl
@@ -0,0 +1,10 @@
+-module(foo_SUITE).
+
+-include_lib("common_test/include/ct.hrl").
+
+-compile(export_all).
+
+all() -> [foo].
+
+foo(Config) ->
+    io:format("Test: ~p\n", [Config]).

http://git-wip-us.apache.org/repos/asf/couchdb/blob/626455a4/src/rebar/inttest/depplugins/depplugins_rt.erl
----------------------------------------------------------------------
diff --git a/src/rebar/inttest/depplugins/depplugins_rt.erl b/src/rebar/inttest/depplugins/depplugins_rt.erl
new file mode 100644
index 0000000..7b106eb
--- /dev/null
+++ b/src/rebar/inttest/depplugins/depplugins_rt.erl
@@ -0,0 +1,50 @@
+%%% @doc Plugin handling test
+%%%
+%%% This test checks if plugins are loaded correctly.
+%%%
+%%% It has three applications:
+%%% <ol>
+%%%   <li>fish. top-level module, has one dependency: `dependsonplugin'.</li>
+%%%   <li>dependsonplugin. This depends on some pre-compile actions by the
+%%%       plugin. In the test the plugin creates a file `pre.compile' in the
+%%%       top-level folder of this application.</li>
+%%%   <li>testplugin. This is a plugin application which creates the file.</li>
+%%% </ol>
+
+-module(depplugins_rt).
+-compile(export_all).
+
+-include_lib("eunit/include/eunit.hrl").
+
+files() ->
+    [
+     {copy, "../../rebar", "rebar"},
+     {copy, "rebar.config", "rebar.config"},
+     {create, "ebin/fish.app", app(fish, [])},
+
+     {create, "deps/dependsonplugin/ebin/dependsonplugin.app",
+        app(dependsonplugin, [])},
+     {copy, "rebar_dependsonplugin.config",
+        "deps/dependsonplugin/rebar.config"},
+     {copy, "testplugin_mod.erl",
+        "deps/testplugin/plugins/testplugin_mod.erl"},
+     {create, "deps/testplugin/ebin/testplugin.app",
+        app(testplugin, [])}
+    ].
+
+run(_Dir) ->
+    ?assertMatch({ok, _}, retest_sh:run("./rebar compile", [])),
+    ?assertEqual(true, filelib:is_regular("deps/dependsonplugin/pre.compile")),
+    ok.
+
+%%
+%% Generate the contents of a simple .app file
+%%
+app(Name, Modules) ->
+    App = {application, Name,
+           [{description, atom_to_list(Name)},
+            {vsn, "1"},
+            {modules, Modules},
+            {registered, []},
+            {applications, [kernel, stdlib]}]},
+    io_lib:format("~p.\n", [App]).

http://git-wip-us.apache.org/repos/asf/couchdb/blob/626455a4/src/rebar/inttest/depplugins/rebar.config
----------------------------------------------------------------------
diff --git a/src/rebar/inttest/depplugins/rebar.config b/src/rebar/inttest/depplugins/rebar.config
new file mode 100644
index 0000000..3a2e34e
--- /dev/null
+++ b/src/rebar/inttest/depplugins/rebar.config
@@ -0,0 +1 @@
+{deps, [dependsonplugin]}.

http://git-wip-us.apache.org/repos/asf/couchdb/blob/626455a4/src/rebar/inttest/depplugins/rebar_dependsonplugin.config
----------------------------------------------------------------------
diff --git a/src/rebar/inttest/depplugins/rebar_dependsonplugin.config b/src/rebar/inttest/depplugins/rebar_dependsonplugin.config
new file mode 100644
index 0000000..df36213
--- /dev/null
+++ b/src/rebar/inttest/depplugins/rebar_dependsonplugin.config
@@ -0,0 +1,2 @@
+{deps, [testplugin]}.
+{plugins, [testplugin_mod]}.

http://git-wip-us.apache.org/repos/asf/couchdb/blob/626455a4/src/rebar/inttest/depplugins/testplugin_mod.erl
----------------------------------------------------------------------
diff --git a/src/rebar/inttest/depplugins/testplugin_mod.erl b/src/rebar/inttest/depplugins/testplugin_mod.erl
new file mode 100644
index 0000000..055bbc7
--- /dev/null
+++ b/src/rebar/inttest/depplugins/testplugin_mod.erl
@@ -0,0 +1,6 @@
+-module(testplugin_mod).
+-compile(export_all).
+
+pre_compile(Config, _) ->
+    ok = file:write_file("pre.compile", <<"Yadda!">>),
+    rebar_log:log(info, "Wrote ~p/pre.compile~n", [rebar_utils:get_cwd()]).

http://git-wip-us.apache.org/repos/asf/couchdb/blob/626455a4/src/rebar/inttest/rgen1/reltool.config
----------------------------------------------------------------------
diff --git a/src/rebar/inttest/rgen1/reltool.config b/src/rebar/inttest/rgen1/reltool.config
new file mode 100644
index 0000000..4c4713c
--- /dev/null
+++ b/src/rebar/inttest/rgen1/reltool.config
@@ -0,0 +1,31 @@
+%% -*- mode: erlang;erlang-indent-level: 4;indent-tabs-mode: nil -*-
+%% ex: ts=4 sw=4 et
+{sys, [
+       {rel, "rgen1", "0.1",
+        [
+         kernel,
+         stdlib,
+         sasl,
+         crypto
+        ]},
+       {rel, "start_clean", "",
+        [
+         kernel,
+         stdlib
+        ]},
+       {boot_rel, "rgen1"},
+       {profile, embedded},
+       {excl_sys_filters, ["^bin/.*",
+                           "^erts.*/bin/(dialyzer|typer)"]},
+       {excl_archive_filters, [".*"]},
+       {app, sasl, [{incl_cond, include}]}
+      ]}.
+
+{target_dir, "mytarget"}.
+
+{overlay_vars, "vars.config"}.
+
+{overlay, [
+           {mkdir, "data"},
+           {template, "test.config", "etc/test.config"}
+          ]}.

http://git-wip-us.apache.org/repos/asf/couchdb/blob/626455a4/src/rebar/inttest/rgen1/retest.config
----------------------------------------------------------------------
diff --git a/src/rebar/inttest/rgen1/retest.config b/src/rebar/inttest/rgen1/retest.config
new file mode 100644
index 0000000..a04233c
--- /dev/null
+++ b/src/rebar/inttest/rgen1/retest.config
@@ -0,0 +1 @@
+{timeout, 60000}.

http://git-wip-us.apache.org/repos/asf/couchdb/blob/626455a4/src/rebar/inttest/rgen1/rgen1_rt.erl
----------------------------------------------------------------------
diff --git a/src/rebar/inttest/rgen1/rgen1_rt.erl b/src/rebar/inttest/rgen1/rgen1_rt.erl
new file mode 100644
index 0000000..68b6eaf
--- /dev/null
+++ b/src/rebar/inttest/rgen1/rgen1_rt.erl
@@ -0,0 +1,18 @@
+-module(rgen1_rt).
+
+-compile(export_all).
+
+%% Exercise release generation w/ templating
+
+files() ->
+    [
+     {copy, "reltool.config"},
+     {copy, "test.config"},
+     {copy, "vars.config"},
+     {copy, "../../rebar"}
+    ].
+
+run(_Dir) ->
+    {ok, _} = retest_sh:run("./rebar -v generate", []),
+    true = filelib:is_dir("mytarget"),
+    ok.

http://git-wip-us.apache.org/repos/asf/couchdb/blob/626455a4/src/rebar/inttest/rgen1/test.config
----------------------------------------------------------------------
diff --git a/src/rebar/inttest/rgen1/test.config b/src/rebar/inttest/rgen1/test.config
new file mode 100644
index 0000000..2fd1385
--- /dev/null
+++ b/src/rebar/inttest/rgen1/test.config
@@ -0,0 +1 @@
+{web_port, {{web_port}} }.

http://git-wip-us.apache.org/repos/asf/couchdb/blob/626455a4/src/rebar/inttest/rgen1/vars.config
----------------------------------------------------------------------
diff --git a/src/rebar/inttest/rgen1/vars.config b/src/rebar/inttest/rgen1/vars.config
new file mode 100644
index 0000000..174c51e
--- /dev/null
+++ b/src/rebar/inttest/rgen1/vars.config
@@ -0,0 +1 @@
+{web_port, 1234}.

http://git-wip-us.apache.org/repos/asf/couchdb/blob/626455a4/src/rebar/inttest/t_custom_config/custom.config
----------------------------------------------------------------------
diff --git a/src/rebar/inttest/t_custom_config/custom.config b/src/rebar/inttest/t_custom_config/custom.config
new file mode 100644
index 0000000..711c27f
--- /dev/null
+++ b/src/rebar/inttest/t_custom_config/custom.config
@@ -0,0 +1,4 @@
+{deps, [
+    {boo, "."}
+]}.
+{erl_opts, [warnings_as_errors]}.

http://git-wip-us.apache.org/repos/asf/couchdb/blob/626455a4/src/rebar/inttest/t_custom_config/custom_config.erl
----------------------------------------------------------------------
diff --git a/src/rebar/inttest/t_custom_config/custom_config.erl b/src/rebar/inttest/t_custom_config/custom_config.erl
new file mode 100644
index 0000000..8656201
--- /dev/null
+++ b/src/rebar/inttest/t_custom_config/custom_config.erl
@@ -0,0 +1,6 @@
+-module(custom_config).
+
+-compile(export_all).
+
+test() ->
+    ok.

http://git-wip-us.apache.org/repos/asf/couchdb/blob/626455a4/src/rebar/inttest/t_custom_config/t_custom_config_rt.erl
----------------------------------------------------------------------
diff --git a/src/rebar/inttest/t_custom_config/t_custom_config_rt.erl b/src/rebar/inttest/t_custom_config/t_custom_config_rt.erl
new file mode 100644
index 0000000..864ce5e
--- /dev/null
+++ b/src/rebar/inttest/t_custom_config/t_custom_config_rt.erl
@@ -0,0 +1,39 @@
+-module(t_custom_config_rt).
+
+-compile(export_all).
+
+-include_lib("eunit/include/eunit.hrl").
+
+files() ->
+    [{copy, "../../rebar", "rebar"},
+     {copy, "custom.config", "custom.config"},
+     {create, "ebin/custom_config.app", app(custom_config, [custom_config])}].
+
+run(Dir) ->
+    retest_log:log(debug, "Running in Dir: ~s~n", [Dir]),
+    Ref = retest:sh("./rebar -C custom.config check-deps -vvv",
+                    [{async, true}]),
+    {ok, Captured} =
+        retest:sh_expect(Ref,
+                         "DEBUG: Consult config file .*/custom.config.*",
+                         [{capture, all, list}]),
+    {ok, Missing} =
+        retest:sh_expect(Ref,
+                         "DEBUG: Missing deps  : \\[\\{dep,bad_name,"
+                         "boo,\"\\.\",undefined,false\\}\\]",
+                         [{capture, all, list}]),
+    retest_log:log(debug, "[CAPTURED]: ~s~n", [Captured]),
+    retest_log:log(debug, "[Missing]: ~s~n", [Missing]),
+    ok.
+
+%%
+%% Generate the contents of a simple .app file
+%%
+app(Name, Modules) ->
+    App = {application, Name,
+           [{description, atom_to_list(Name)},
+            {vsn, "1"},
+            {modules, Modules},
+            {registered, []},
+            {applications, [kernel, stdlib]}]},
+    io_lib:format("~p.\n", [App]).

http://git-wip-us.apache.org/repos/asf/couchdb/blob/626455a4/src/rebar/inttest/tdeps1/a.erl
----------------------------------------------------------------------
diff --git a/src/rebar/inttest/tdeps1/a.erl b/src/rebar/inttest/tdeps1/a.erl
new file mode 100644
index 0000000..835522a
--- /dev/null
+++ b/src/rebar/inttest/tdeps1/a.erl
@@ -0,0 +1,8 @@
+-module(a).
+
+-compile(export_all).
+
+-include_lib("b/include/b.hrl").
+
+hello() ->
+    io:format("~s\n", [?HELLO]).

http://git-wip-us.apache.org/repos/asf/couchdb/blob/626455a4/src/rebar/inttest/tdeps1/a.rebar.config
----------------------------------------------------------------------
diff --git a/src/rebar/inttest/tdeps1/a.rebar.config b/src/rebar/inttest/tdeps1/a.rebar.config
new file mode 100644
index 0000000..991ea5a
--- /dev/null
+++ b/src/rebar/inttest/tdeps1/a.rebar.config
@@ -0,0 +1 @@
+{deps, [{b, "1", {git, "../repo/b"}}]}.

http://git-wip-us.apache.org/repos/asf/couchdb/blob/626455a4/src/rebar/inttest/tdeps1/b.hrl
----------------------------------------------------------------------
diff --git a/src/rebar/inttest/tdeps1/b.hrl b/src/rebar/inttest/tdeps1/b.hrl
new file mode 100644
index 0000000..efbeab1
--- /dev/null
+++ b/src/rebar/inttest/tdeps1/b.hrl
@@ -0,0 +1 @@
+-include_lib("c/include/c.hrl").

http://git-wip-us.apache.org/repos/asf/couchdb/blob/626455a4/src/rebar/inttest/tdeps1/b.rebar.config
----------------------------------------------------------------------
diff --git a/src/rebar/inttest/tdeps1/b.rebar.config b/src/rebar/inttest/tdeps1/b.rebar.config
new file mode 100644
index 0000000..ffbd0db
--- /dev/null
+++ b/src/rebar/inttest/tdeps1/b.rebar.config
@@ -0,0 +1 @@
+{deps, [{c, "1", {git, "../repo/c"}}]}.

http://git-wip-us.apache.org/repos/asf/couchdb/blob/626455a4/src/rebar/inttest/tdeps1/c.hrl
----------------------------------------------------------------------
diff --git a/src/rebar/inttest/tdeps1/c.hrl b/src/rebar/inttest/tdeps1/c.hrl
new file mode 100644
index 0000000..9f02fab
--- /dev/null
+++ b/src/rebar/inttest/tdeps1/c.hrl
@@ -0,0 +1 @@
+-define(HELLO, hello).

http://git-wip-us.apache.org/repos/asf/couchdb/blob/626455a4/src/rebar/inttest/tdeps1/tdeps1_rt.erl
----------------------------------------------------------------------
diff --git a/src/rebar/inttest/tdeps1/tdeps1_rt.erl b/src/rebar/inttest/tdeps1/tdeps1_rt.erl
new file mode 100644
index 0000000..3de1a2b
--- /dev/null
+++ b/src/rebar/inttest/tdeps1/tdeps1_rt.erl
@@ -0,0 +1,59 @@
+-module(tdeps1_rt).
+
+-compile(export_all).
+
+%% Exercise transitive dependencies
+%% A -> B -> C, where A includes a .hrl from B which includes .hrl from C
+
+files() ->
+    [
+     %% A application
+     {create, "ebin/a.app", app(a, [a])},
+     {copy, "a.rebar.config", "rebar.config"},
+     {copy, "a.erl", "src/a.erl"},
+     {copy, "../../rebar", "rebar"},
+
+     %% B application
+     {create, "repo/b/ebin/b.app", app(b, [])},
+     {copy, "b.rebar.config", "repo/b/rebar.config"},
+     {copy, "b.hrl", "repo/b/include/b.hrl"},
+
+     %% C application
+     {create, "repo/c/ebin/c.app", app(c, [])},
+     {copy, "c.hrl", "repo/c/include/c.hrl"}
+    ].
+
+apply_cmds([], _Params) ->
+    ok;
+apply_cmds([Cmd | Rest], Params) ->
+    io:format("Running: ~s (~p)\n", [Cmd, Params]),
+    {ok, _} = retest_sh:run(Cmd, Params),
+    apply_cmds(Rest, Params).
+
+run(_Dir) ->
+    %% Initialize the b/c apps as git repos so that dependencies pull
+    %% properly
+    GitCmds = ["git init",
+               "git add -A",
+               "git config user.email 'tdeps@example.com'",
+               "git config user.name 'tdeps'",
+               "git commit -a -m 'Initial Commit'"],
+    apply_cmds(GitCmds, [{dir, "repo/b"}]),
+    apply_cmds(GitCmds, [{dir, "repo/c"}]),
+
+    {ok, _} = retest_sh:run("./rebar get-deps compile", []),
+
+    true = filelib:is_regular("ebin/a.beam"),
+    ok.
+
+%%
+%% Generate the contents of a simple .app file
+%%
+app(Name, Modules) ->
+    App = {application, Name,
+           [{description, atom_to_list(Name)},
+            {vsn, "1"},
+            {modules, Modules},
+            {registered, []},
+            {applications, [kernel, stdlib]}]},
+    io_lib:format("~p.\n", [App]).

http://git-wip-us.apache.org/repos/asf/couchdb/blob/626455a4/src/rebar/inttest/tdeps2/a.erl
----------------------------------------------------------------------
diff --git a/src/rebar/inttest/tdeps2/a.erl b/src/rebar/inttest/tdeps2/a.erl
new file mode 100644
index 0000000..294ae21
--- /dev/null
+++ b/src/rebar/inttest/tdeps2/a.erl
@@ -0,0 +1,3 @@
+-module({{module}}).
+
+-include_lib("b/include/b.hrl").

http://git-wip-us.apache.org/repos/asf/couchdb/blob/626455a4/src/rebar/inttest/tdeps2/a.rebar.config
----------------------------------------------------------------------
diff --git a/src/rebar/inttest/tdeps2/a.rebar.config b/src/rebar/inttest/tdeps2/a.rebar.config
new file mode 100644
index 0000000..991ea5a
--- /dev/null
+++ b/src/rebar/inttest/tdeps2/a.rebar.config
@@ -0,0 +1 @@
+{deps, [{b, "1", {git, "../repo/b"}}]}.

http://git-wip-us.apache.org/repos/asf/couchdb/blob/626455a4/src/rebar/inttest/tdeps2/b.hrl
----------------------------------------------------------------------
diff --git a/src/rebar/inttest/tdeps2/b.hrl b/src/rebar/inttest/tdeps2/b.hrl
new file mode 100644
index 0000000..efbeab1
--- /dev/null
+++ b/src/rebar/inttest/tdeps2/b.hrl
@@ -0,0 +1 @@
+-include_lib("c/include/c.hrl").

http://git-wip-us.apache.org/repos/asf/couchdb/blob/626455a4/src/rebar/inttest/tdeps2/b.rebar.config
----------------------------------------------------------------------
diff --git a/src/rebar/inttest/tdeps2/b.rebar.config b/src/rebar/inttest/tdeps2/b.rebar.config
new file mode 100644
index 0000000..ffbd0db
--- /dev/null
+++ b/src/rebar/inttest/tdeps2/b.rebar.config
@@ -0,0 +1 @@
+{deps, [{c, "1", {git, "../repo/c"}}]}.

http://git-wip-us.apache.org/repos/asf/couchdb/blob/626455a4/src/rebar/inttest/tdeps2/c.hrl
----------------------------------------------------------------------
diff --git a/src/rebar/inttest/tdeps2/c.hrl b/src/rebar/inttest/tdeps2/c.hrl
new file mode 100644
index 0000000..9f02fab
--- /dev/null
+++ b/src/rebar/inttest/tdeps2/c.hrl
@@ -0,0 +1 @@
+-define(HELLO, hello).

http://git-wip-us.apache.org/repos/asf/couchdb/blob/626455a4/src/rebar/inttest/tdeps2/root.rebar.config
----------------------------------------------------------------------
diff --git a/src/rebar/inttest/tdeps2/root.rebar.config b/src/rebar/inttest/tdeps2/root.rebar.config
new file mode 100644
index 0000000..005adfe
--- /dev/null
+++ b/src/rebar/inttest/tdeps2/root.rebar.config
@@ -0,0 +1,2 @@
+{sub_dirs, ["apps/a1",
+            "apps/a2"]}.

http://git-wip-us.apache.org/repos/asf/couchdb/blob/626455a4/src/rebar/inttest/tdeps2/tdeps2_rt.erl
----------------------------------------------------------------------
diff --git a/src/rebar/inttest/tdeps2/tdeps2_rt.erl b/src/rebar/inttest/tdeps2/tdeps2_rt.erl
new file mode 100644
index 0000000..987567e
--- /dev/null
+++ b/src/rebar/inttest/tdeps2/tdeps2_rt.erl
@@ -0,0 +1,65 @@
+-module(tdeps2_rt).
+
+-compile(export_all).
+
+%% Exercise transitive dependencies where there are multiple files
+%% depending on the same set of deps
+%% [A1, A2] -> B -> C ; A1 and A2 includes B.hrl which includes C.hrl
+
+files() ->
+    [
+     %% A1 application
+     {create, "apps/a1/ebin/a1.app", app(a1, [a1])},
+     {copy, "a.rebar.config", "apps/a1/rebar.config"},
+     {template, "a.erl", "apps/a1/src/a1.erl", dict:from_list([{module, a1}])},
+
+     %% A2 application
+     {create, "apps/a2/ebin/a2.app", app(a2, [a2])},
+     {copy, "a.rebar.config", "apps/a2/rebar.config"},
+     {template, "a.erl", "apps/a2/src/a2.erl", dict:from_list([{module, a2}])},
+
+     {copy, "root.rebar.config", "rebar.config"},
+     {copy, "../../rebar", "rebar"},
+
+     %% B application
+     {create, "repo/b/ebin/b.app", app(b, [])},
+     {copy, "b.rebar.config", "repo/b/rebar.config"},
+     {copy, "b.hrl", "repo/b/include/b.hrl"},
+
+     %% C application
+     {create, "repo/c/ebin/c.app", app(c, [])},
+     {copy, "c.hrl", "repo/c/include/c.hrl"}
+    ].
+
+apply_cmds([], _Params) ->
+    ok;
+apply_cmds([Cmd | Rest], Params) ->
+    io:format("Running: ~s (~p)\n", [Cmd, Params]),
+    {ok, _} = retest_sh:run(Cmd, Params),
+    apply_cmds(Rest, Params).
+
+run(_Dir) ->
+    %% Initialize the b/c apps as git repos so that dependencies pull
+    %% properly
+    GitCmds = ["git init",
+               "git add -A",
+               "git config user.email 'tdeps@example.com'",
+               "git config user.name 'tdeps'",
+               "git commit -a -m 'Initial Commit'"],
+    ok = apply_cmds(GitCmds, [{dir, "repo/b"}]),
+    ok = apply_cmds(GitCmds, [{dir, "repo/c"}]),
+
+    {ok, _} = retest_sh:run("./rebar -v get-deps compile", []),
+    ok.
+
+%%
+%% Generate the contents of a simple .app file
+%%
+app(Name, Modules) ->
+    App = {application, Name,
+           [{description, atom_to_list(Name)},
+            {vsn, "1"},
+            {modules, Modules},
+            {registered, []},
+            {applications, [kernel, stdlib]}]},
+    io_lib:format("~p.\n", [App]).

http://git-wip-us.apache.org/repos/asf/couchdb/blob/626455a4/src/rebar/inttest/tdeps3/a.erl
----------------------------------------------------------------------
diff --git a/src/rebar/inttest/tdeps3/a.erl b/src/rebar/inttest/tdeps3/a.erl
new file mode 100644
index 0000000..5a387eb
--- /dev/null
+++ b/src/rebar/inttest/tdeps3/a.erl
@@ -0,0 +1,3 @@
+-module({{module}}).
+
+-include_lib("{{dep}}/include/{{dep}}.hrl").

http://git-wip-us.apache.org/repos/asf/couchdb/blob/626455a4/src/rebar/inttest/tdeps3/a.rebar.config
----------------------------------------------------------------------
diff --git a/src/rebar/inttest/tdeps3/a.rebar.config b/src/rebar/inttest/tdeps3/a.rebar.config
new file mode 100644
index 0000000..19b8ef8
--- /dev/null
+++ b/src/rebar/inttest/tdeps3/a.rebar.config
@@ -0,0 +1,4 @@
+{deps, [
+	{b, "1", {git, "../repo/b"}},
+	{f, "1", {git, "../repo/f"}}
+]}.

http://git-wip-us.apache.org/repos/asf/couchdb/blob/626455a4/src/rebar/inttest/tdeps3/b.hrl
----------------------------------------------------------------------
diff --git a/src/rebar/inttest/tdeps3/b.hrl b/src/rebar/inttest/tdeps3/b.hrl
new file mode 100644
index 0000000..efbeab1
--- /dev/null
+++ b/src/rebar/inttest/tdeps3/b.hrl
@@ -0,0 +1 @@
+-include_lib("c/include/c.hrl").

http://git-wip-us.apache.org/repos/asf/couchdb/blob/626455a4/src/rebar/inttest/tdeps3/b.rebar.config
----------------------------------------------------------------------
diff --git a/src/rebar/inttest/tdeps3/b.rebar.config b/src/rebar/inttest/tdeps3/b.rebar.config
new file mode 100644
index 0000000..d1ccae2
--- /dev/null
+++ b/src/rebar/inttest/tdeps3/b.rebar.config
@@ -0,0 +1,5 @@
+{deps, [
+	{c, "1", {git, "../repo/c"}}
+]}.
+
+{lib_dirs, [apps]}.

http://git-wip-us.apache.org/repos/asf/couchdb/blob/626455a4/src/rebar/inttest/tdeps3/c.hrl
----------------------------------------------------------------------
diff --git a/src/rebar/inttest/tdeps3/c.hrl b/src/rebar/inttest/tdeps3/c.hrl
new file mode 100644
index 0000000..cc87fff
--- /dev/null
+++ b/src/rebar/inttest/tdeps3/c.hrl
@@ -0,0 +1 @@
+-include_lib("d/include/d.hrl").

http://git-wip-us.apache.org/repos/asf/couchdb/blob/626455a4/src/rebar/inttest/tdeps3/c.rebar.config
----------------------------------------------------------------------
diff --git a/src/rebar/inttest/tdeps3/c.rebar.config b/src/rebar/inttest/tdeps3/c.rebar.config
new file mode 100644
index 0000000..b590771
--- /dev/null
+++ b/src/rebar/inttest/tdeps3/c.rebar.config
@@ -0,0 +1 @@
+{deps, [{d, "1", {git, "../repo/d"}}]}.

http://git-wip-us.apache.org/repos/asf/couchdb/blob/626455a4/src/rebar/inttest/tdeps3/d.hrl
----------------------------------------------------------------------
diff --git a/src/rebar/inttest/tdeps3/d.hrl b/src/rebar/inttest/tdeps3/d.hrl
new file mode 100644
index 0000000..02f8088
--- /dev/null
+++ b/src/rebar/inttest/tdeps3/d.hrl
@@ -0,0 +1 @@
+-include_lib("e/include/e.hrl").

http://git-wip-us.apache.org/repos/asf/couchdb/blob/626455a4/src/rebar/inttest/tdeps3/d.rebar.config
----------------------------------------------------------------------
diff --git a/src/rebar/inttest/tdeps3/d.rebar.config b/src/rebar/inttest/tdeps3/d.rebar.config
new file mode 100644
index 0000000..4c7cd54
--- /dev/null
+++ b/src/rebar/inttest/tdeps3/d.rebar.config
@@ -0,0 +1 @@
+{deps, [{e, "1", {git, "../repo/e"}}]}.

http://git-wip-us.apache.org/repos/asf/couchdb/blob/626455a4/src/rebar/inttest/tdeps3/e.hrl
----------------------------------------------------------------------
diff --git a/src/rebar/inttest/tdeps3/e.hrl b/src/rebar/inttest/tdeps3/e.hrl
new file mode 100644
index 0000000..9f02fab
--- /dev/null
+++ b/src/rebar/inttest/tdeps3/e.hrl
@@ -0,0 +1 @@
+-define(HELLO, hello).

http://git-wip-us.apache.org/repos/asf/couchdb/blob/626455a4/src/rebar/inttest/tdeps3/f.hrl
----------------------------------------------------------------------
diff --git a/src/rebar/inttest/tdeps3/f.hrl b/src/rebar/inttest/tdeps3/f.hrl
new file mode 100644
index 0000000..02f8088
--- /dev/null
+++ b/src/rebar/inttest/tdeps3/f.hrl
@@ -0,0 +1 @@
+-include_lib("e/include/e.hrl").

http://git-wip-us.apache.org/repos/asf/couchdb/blob/626455a4/src/rebar/inttest/tdeps3/root.rebar.config
----------------------------------------------------------------------
diff --git a/src/rebar/inttest/tdeps3/root.rebar.config b/src/rebar/inttest/tdeps3/root.rebar.config
new file mode 100644
index 0000000..d1c3793
--- /dev/null
+++ b/src/rebar/inttest/tdeps3/root.rebar.config
@@ -0,0 +1 @@
+{sub_dirs, ["apps/a"]}.

http://git-wip-us.apache.org/repos/asf/couchdb/blob/626455a4/src/rebar/inttest/tdeps3/tdeps3_rt.erl
----------------------------------------------------------------------
diff --git a/src/rebar/inttest/tdeps3/tdeps3_rt.erl b/src/rebar/inttest/tdeps3/tdeps3_rt.erl
new file mode 100644
index 0000000..da87d43
--- /dev/null
+++ b/src/rebar/inttest/tdeps3/tdeps3_rt.erl
@@ -0,0 +1,89 @@
+-module(tdeps3_rt).
+
+-compile(export_all).
+
+%% Exercise transitive dependencies where there are multiple files
+%% depending on the same set of deps as well as lib_dir directives
+%% A -> B -> C -> D -> E
+%%      |--> G(via lib_dir)
+%% |--> F -> D -> E
+
+files() ->
+    [
+     %% A1 application
+     {create, "ebin/a.app", app(a, [a])},
+     {template, "a.erl", "src/a.erl", dict:from_list([{module, a}, {dep, b}])},
+
+     {copy, "a.rebar.config", "rebar.config"},
+     {copy, "../../rebar", "rebar"},
+
+     %% B application
+     {create, "repo/b/ebin/b.app", app(b, [b])},
+     {template, "a.erl", "repo/b/src/b.erl", dict:from_list([{module, b}, {dep, b}])},
+     {copy, "b.rebar.config", "repo/b/rebar.config"},
+     {copy, "b.hrl", "repo/b/include/b.hrl"},
+
+     %% C application
+     {create, "repo/c/ebin/c.app", app(c, [c])},
+     {template, "a.erl", "repo/c/src/c.erl", dict:from_list([{module, c}, {dep, d}])},
+     {copy, "c.rebar.config", "repo/c/rebar.config"},
+     {copy, "c.hrl", "repo/c/include/c.hrl"},
+
+     %% D application
+     {create, "repo/d/ebin/d.app", app(d, [d])},
+     {template, "a.erl", "repo/d/src/d.erl", dict:from_list([{module, d}, {dep, e}])},
+     {copy, "d.rebar.config", "repo/d/rebar.config"},
+     {copy, "d.hrl", "repo/d/include/d.hrl"},
+
+     %% E application
+     {create, "repo/e/ebin/e.app", app(e, [])},
+     {copy, "e.hrl", "repo/e/include/e.hrl"},
+
+
+     %% F application
+     {create, "repo/f/ebin/f.app", app(f, [f])},
+     {template, "a.erl", "repo/f/src/f.erl", dict:from_list([{module, f}, {dep, d}])},
+     {copy, "c.rebar.config", "repo/f/rebar.config"},
+     {copy, "f.hrl", "repo/f/include/f.hrl"},
+
+     %% G application, which is part of the B repo, in a lib_dir
+     {create, "repo/b/apps/g/ebin/g.app", app(g, [])},
+     {copy, "e.hrl", "repo/b/apps/g/include/g.hrl"}
+
+    ].
+
+apply_cmds([], _Params) ->
+    ok;
+apply_cmds([Cmd | Rest], Params) ->
+    io:format("Running: ~s (~p)\n", [Cmd, Params]),
+    {ok, _} = retest_sh:run(Cmd, Params),
+    apply_cmds(Rest, Params).
+
+run(_Dir) ->
+    %% Initialize the b/c apps as git repos so that dependencies pull
+    %% properly
+    GitCmds = ["git init",
+               "git add -A",
+               "git config user.email 'tdeps@example.com'",
+               "git config user.name 'tdeps'",
+               "git commit -a -m 'Initial Commit'"],
+    ok = apply_cmds(GitCmds, [{dir, "repo/b"}]),
+    ok = apply_cmds(GitCmds, [{dir, "repo/c"}]),
+    ok = apply_cmds(GitCmds, [{dir, "repo/d"}]),
+    ok = apply_cmds(GitCmds, [{dir, "repo/e"}]),
+    ok = apply_cmds(GitCmds, [{dir, "repo/f"}]),
+
+    {ok, _} = retest_sh:run("./rebar -v get-deps compile", []),
+    ok.
+
+%%
+%% Generate the contents of a simple .app file
+%%
+app(Name, Modules) ->
+    App = {application, Name,
+           [{description, atom_to_list(Name)},
+            {vsn, "1"},
+            {modules, Modules},
+            {registered, []},
+            {applications, [kernel, stdlib]}]},
+    io_lib:format("~p.\n", [App]).

http://git-wip-us.apache.org/repos/asf/couchdb/blob/626455a4/src/rebar/inttest/tdeps_update/a.erl
----------------------------------------------------------------------
diff --git a/src/rebar/inttest/tdeps_update/a.erl b/src/rebar/inttest/tdeps_update/a.erl
new file mode 100644
index 0000000..294ae21
--- /dev/null
+++ b/src/rebar/inttest/tdeps_update/a.erl
@@ -0,0 +1,3 @@
+-module({{module}}).
+
+-include_lib("b/include/b.hrl").

http://git-wip-us.apache.org/repos/asf/couchdb/blob/626455a4/src/rebar/inttest/tdeps_update/a.rebar.config
----------------------------------------------------------------------
diff --git a/src/rebar/inttest/tdeps_update/a.rebar.config b/src/rebar/inttest/tdeps_update/a.rebar.config
new file mode 100644
index 0000000..3b721dc
--- /dev/null
+++ b/src/rebar/inttest/tdeps_update/a.rebar.config
@@ -0,0 +1 @@
+{deps, [{b, "0.2.3", {git, "../repo/b", {tag, "0.2.3"}}}]}.

http://git-wip-us.apache.org/repos/asf/couchdb/blob/626455a4/src/rebar/inttest/tdeps_update/a2.rebar.config
----------------------------------------------------------------------
diff --git a/src/rebar/inttest/tdeps_update/a2.rebar.config b/src/rebar/inttest/tdeps_update/a2.rebar.config
new file mode 100644
index 0000000..5687349
--- /dev/null
+++ b/src/rebar/inttest/tdeps_update/a2.rebar.config
@@ -0,0 +1 @@
+{deps, [{b, "0.2.4", {git, "../repo/b", {tag, "0.2.4"}}}]}.

http://git-wip-us.apache.org/repos/asf/couchdb/blob/626455a4/src/rebar/inttest/tdeps_update/a3.rebar.config
----------------------------------------------------------------------
diff --git a/src/rebar/inttest/tdeps_update/a3.rebar.config b/src/rebar/inttest/tdeps_update/a3.rebar.config
new file mode 100644
index 0000000..86bf462
--- /dev/null
+++ b/src/rebar/inttest/tdeps_update/a3.rebar.config
@@ -0,0 +1 @@
+{deps, [{b, "0.2.5", {git, "../repo/b", {tag, "0.2.5"}}}]}.

http://git-wip-us.apache.org/repos/asf/couchdb/blob/626455a4/src/rebar/inttest/tdeps_update/a4.rebar.config
----------------------------------------------------------------------
diff --git a/src/rebar/inttest/tdeps_update/a4.rebar.config b/src/rebar/inttest/tdeps_update/a4.rebar.config
new file mode 100644
index 0000000..bfba813
--- /dev/null
+++ b/src/rebar/inttest/tdeps_update/a4.rebar.config
@@ -0,0 +1,4 @@
+{deps, [
+        {b, "0.2.6", {git, "../repo/b", {tag, "0.2.6"}}},
+        {f, "0.1", {git, "../repo/f", {tag, "0.1"}}}
+       ]}.

http://git-wip-us.apache.org/repos/asf/couchdb/blob/626455a4/src/rebar/inttest/tdeps_update/b.hrl
----------------------------------------------------------------------
diff --git a/src/rebar/inttest/tdeps_update/b.hrl b/src/rebar/inttest/tdeps_update/b.hrl
new file mode 100644
index 0000000..efbeab1
--- /dev/null
+++ b/src/rebar/inttest/tdeps_update/b.hrl
@@ -0,0 +1 @@
+-include_lib("c/include/c.hrl").

http://git-wip-us.apache.org/repos/asf/couchdb/blob/626455a4/src/rebar/inttest/tdeps_update/b.rebar.config
----------------------------------------------------------------------
diff --git a/src/rebar/inttest/tdeps_update/b.rebar.config b/src/rebar/inttest/tdeps_update/b.rebar.config
new file mode 100644
index 0000000..536aaa9
--- /dev/null
+++ b/src/rebar/inttest/tdeps_update/b.rebar.config
@@ -0,0 +1 @@
+{deps, [{c, "1.0", {git, "../repo/c", {tag, "1.0"}}}]}.

http://git-wip-us.apache.org/repos/asf/couchdb/blob/626455a4/src/rebar/inttest/tdeps_update/b2.rebar.config
----------------------------------------------------------------------
diff --git a/src/rebar/inttest/tdeps_update/b2.rebar.config b/src/rebar/inttest/tdeps_update/b2.rebar.config
new file mode 100644
index 0000000..b603277
--- /dev/null
+++ b/src/rebar/inttest/tdeps_update/b2.rebar.config
@@ -0,0 +1 @@
+{deps, [{c, "1.1", {git, "../repo/c", {tag, "1.1"}}}]}.

http://git-wip-us.apache.org/repos/asf/couchdb/blob/626455a4/src/rebar/inttest/tdeps_update/b3.rebar.config
----------------------------------------------------------------------
diff --git a/src/rebar/inttest/tdeps_update/b3.rebar.config b/src/rebar/inttest/tdeps_update/b3.rebar.config
new file mode 100644
index 0000000..5f4e20a
--- /dev/null
+++ b/src/rebar/inttest/tdeps_update/b3.rebar.config
@@ -0,0 +1 @@
+{deps, [{c, "1.2", {git, "../repo/c", {tag, "1.2"}}}]}.

http://git-wip-us.apache.org/repos/asf/couchdb/blob/626455a4/src/rebar/inttest/tdeps_update/b4.rebar.config
----------------------------------------------------------------------
diff --git a/src/rebar/inttest/tdeps_update/b4.rebar.config b/src/rebar/inttest/tdeps_update/b4.rebar.config
new file mode 100644
index 0000000..5fd1dca
--- /dev/null
+++ b/src/rebar/inttest/tdeps_update/b4.rebar.config
@@ -0,0 +1 @@
+{deps, [{c, "1.3", {git, "../repo/c", {tag, "1.3"}}}]}.

http://git-wip-us.apache.org/repos/asf/couchdb/blob/626455a4/src/rebar/inttest/tdeps_update/c.hrl
----------------------------------------------------------------------
diff --git a/src/rebar/inttest/tdeps_update/c.hrl b/src/rebar/inttest/tdeps_update/c.hrl
new file mode 100644
index 0000000..9f02fab
--- /dev/null
+++ b/src/rebar/inttest/tdeps_update/c.hrl
@@ -0,0 +1 @@
+-define(HELLO, hello).

http://git-wip-us.apache.org/repos/asf/couchdb/blob/626455a4/src/rebar/inttest/tdeps_update/c.rebar.config
----------------------------------------------------------------------
diff --git a/src/rebar/inttest/tdeps_update/c.rebar.config b/src/rebar/inttest/tdeps_update/c.rebar.config
new file mode 100644
index 0000000..d99b963
--- /dev/null
+++ b/src/rebar/inttest/tdeps_update/c.rebar.config
@@ -0,0 +1 @@
+{deps, [{d, "0.7", {git, "../repo/d", {tag, "0.7"}}}]}.

http://git-wip-us.apache.org/repos/asf/couchdb/blob/626455a4/src/rebar/inttest/tdeps_update/c2.hrl
----------------------------------------------------------------------
diff --git a/src/rebar/inttest/tdeps_update/c2.hrl b/src/rebar/inttest/tdeps_update/c2.hrl
new file mode 100644
index 0000000..cc87fff
--- /dev/null
+++ b/src/rebar/inttest/tdeps_update/c2.hrl
@@ -0,0 +1 @@
+-include_lib("d/include/d.hrl").

http://git-wip-us.apache.org/repos/asf/couchdb/blob/626455a4/src/rebar/inttest/tdeps_update/c2.rebar.config
----------------------------------------------------------------------
diff --git a/src/rebar/inttest/tdeps_update/c2.rebar.config b/src/rebar/inttest/tdeps_update/c2.rebar.config
new file mode 100644
index 0000000..1297e07
--- /dev/null
+++ b/src/rebar/inttest/tdeps_update/c2.rebar.config
@@ -0,0 +1,4 @@
+{deps, [
+    {d, "0.7", {git, "../repo/d", {tag, "0.7"}}},
+    {e, "2.0", {git, "../repo/e", {tag, "2.0"}}}
+    ]}.

http://git-wip-us.apache.org/repos/asf/couchdb/blob/626455a4/src/rebar/inttest/tdeps_update/c3.rebar.config
----------------------------------------------------------------------
diff --git a/src/rebar/inttest/tdeps_update/c3.rebar.config b/src/rebar/inttest/tdeps_update/c3.rebar.config
new file mode 100644
index 0000000..40c93c5
--- /dev/null
+++ b/src/rebar/inttest/tdeps_update/c3.rebar.config
@@ -0,0 +1,4 @@
+{deps, [
+    {d, "0.7", {git, "../repo/d", {tag, "0.7"}}},
+    {e, "2.1", {git, "../repo/e", {tag, "2.1"}}}
+    ]}.

http://git-wip-us.apache.org/repos/asf/couchdb/blob/626455a4/src/rebar/inttest/tdeps_update/d.hrl
----------------------------------------------------------------------
diff --git a/src/rebar/inttest/tdeps_update/d.hrl b/src/rebar/inttest/tdeps_update/d.hrl
new file mode 100644
index 0000000..9f02fab
--- /dev/null
+++ b/src/rebar/inttest/tdeps_update/d.hrl
@@ -0,0 +1 @@
+-define(HELLO, hello).

http://git-wip-us.apache.org/repos/asf/couchdb/blob/626455a4/src/rebar/inttest/tdeps_update/root.rebar.config
----------------------------------------------------------------------
diff --git a/src/rebar/inttest/tdeps_update/root.rebar.config b/src/rebar/inttest/tdeps_update/root.rebar.config
new file mode 100644
index 0000000..ea03437
--- /dev/null
+++ b/src/rebar/inttest/tdeps_update/root.rebar.config
@@ -0,0 +1 @@
+{sub_dirs, ["apps/a1"]}.

http://git-wip-us.apache.org/repos/asf/couchdb/blob/626455a4/src/rebar/inttest/tdeps_update/tdeps_update_rt.erl
----------------------------------------------------------------------
diff --git a/src/rebar/inttest/tdeps_update/tdeps_update_rt.erl b/src/rebar/inttest/tdeps_update/tdeps_update_rt.erl
new file mode 100644
index 0000000..81bb7ef
--- /dev/null
+++ b/src/rebar/inttest/tdeps_update/tdeps_update_rt.erl
@@ -0,0 +1,147 @@
+-module(tdeps_update_rt).
+
+-compile(export_all).
+
+%% Exercises update deps, with recursive dependency updates.
+%% Initially:
+%%     A(v0.5) -> B(v0.2.3) -> C(v1.0)
+%% But after updating A to 0.6:
+%%     A(v0.6) -> B(v0.2.4) -> C(v1.1)
+%%                          -> D(v0.7)
+%% And after updating A to 0.7:
+%%     A(v0.7) -> B(v0.2.5) -> C(v1.2) -> E(v2.0)
+%%                          -> D(v0.7)
+%% And after updating A to 0.8:
+%%     A(v0.8) -> B(v0.2.6) -> C(v1.3) -> E(v2.1)
+%%                          -> D(v0.7)
+%%             -> F(v0.1)   -> E(v2.1)
+files() ->
+    [
+     %% A1 application
+     {create, "apps/a1/ebin/a1.app", app(a1, [a1], "0.5")},
+     {copy, "a.rebar.config", "apps/a1/rebar.config"},
+     {template, "a.erl", "apps/a1/src/a1.erl", dict:from_list([{module, a1}])},
+
+     {copy, "root.rebar.config", "rebar.config"},
+     {copy, "../../rebar", "rebar"},
+
+     %% B application
+     {create, "repo/b/ebin/b.app", app(b, [], "0.2.3")},
+     {create, "b2.app", app(b, [], "0.2.4")},
+     {create, "b3.app", app(b, [], "0.2.5")},
+     {create, "b4.app", app(b, [], "0.2.6")},
+     {copy, "b.rebar.config", "repo/b/rebar.config"},
+     {copy, "b.hrl", "repo/b/include/b.hrl"},
+
+     %% C application
+     {create, "repo/c/ebin/c.app", app(c, [], "1.0")},
+     {create, "c2.app", app(c, [], "1.1")},
+     {create, "c3.app", app(c, [], "1.2")},
+     {create, "c4.app", app(c, [], "1.3")},
+     {copy, "c.hrl", "repo/c/include/c.hrl"},
+
+     %% D application
+     {create, "repo/d/ebin/d.app", app(d, [], "0.7")},
+     {copy, "d.hrl", "repo/d/include/d.hrl"},
+
+     %% E application
+     {create, "repo/e/ebin/e.app", app(e, [], "2.0")},
+     {create, "e2.app", app(e, [], "2.1")},
+
+     %% F application
+     {create, "repo/f/ebin/f.app", app(f, [], "0.1")},
+
+     %% update files
+     {copy, "a2.rebar.config", "a2.rebar.config"},
+     {copy, "a3.rebar.config", "a3.rebar.config"},
+     {copy, "a4.rebar.config", "a4.rebar.config"},
+     {copy, "b2.rebar.config", "b2.rebar.config"},
+     {copy, "b3.rebar.config", "b3.rebar.config"},
+     {copy, "b4.rebar.config", "b4.rebar.config"},
+     {copy, "c2.hrl", "c2.hrl"},
+     {copy, "c.rebar.config", "c.rebar.config"},
+     {copy, "c2.rebar.config", "c2.rebar.config"},
+     {copy, "c3.rebar.config", "c3.rebar.config"}
+    ].
+
+apply_cmds([], _Params) ->
+    ok;
+apply_cmds([Cmd | Rest], Params) ->
+    io:format("Running: ~s (~p)\n", [Cmd, Params]),
+    {ok, _} = retest_sh:run(Cmd, Params),
+    apply_cmds(Rest, Params).
+
+run(_Dir) ->
+    %% Initialize the b/c/d apps as git repos so that dependencies pull
+    %% properly
+    GitCmds = ["git init",
+               "git add -A",
+               "git config user.email 'tdeps@example.com'",
+               "git config user.name 'tdeps'",
+               "git commit -a -m 'Initial Commit'"],
+    BCmds = ["git tag 0.2.3",
+             "cp ../../b2.rebar.config rebar.config",
+             "cp ../../b2.app ebin/b.app",
+             "git commit -a -m 'update to 0.2.4'",
+             "git tag 0.2.4",
+             "cp ../../b3.rebar.config rebar.config",
+             "cp ../../b3.app ebin/b.app",
+             "git commit -a -m 'update to 0.2.5'",
+             "git tag 0.2.5",
+             "cp ../../b4.rebar.config rebar.config",
+             "cp ../../b4.app ebin/b.app",
+             "git commit -a -m 'update to 0.2.6'",
+             "git tag 0.2.6"],
+             %"git checkout 0.2.3"],
+    CCmds = ["git tag 1.0",
+             "cp ../../c2.hrl include/c.hrl",
+             "cp ../../c2.app ebin/c.app",
+             "cp ../../c.rebar.config rebar.config",
+             "git add rebar.config",
+             "git commit -a -m 'update to 1.1'",
+             "git tag 1.1",
+             "cp ../../c3.app ebin/c.app",
+             "cp ../../c2.rebar.config rebar.config",
+             "git commit -a -m 'update to 1.2'",
+             "git tag 1.2",
+             "cp ../../c4.app ebin/c.app",
+             "cp ../../c3.rebar.config rebar.config",
+             "git commit -a -m 'update to 1.3'",
+             "git tag 1.3"],
+             %"git checkout 1.0"],
+    DCmds = ["git tag 0.7"],
+    ECmds = ["git tag 2.0",
+             "cp ../../e2.app ebin/e.app",
+             "git commit -a -m 'update to 2.1'",
+             "git tag 2.1"],
+    FCmds = ["git tag 0.1"],
+
+    ok = apply_cmds(GitCmds++BCmds, [{dir, "repo/b"}]),
+    ok = apply_cmds(GitCmds++CCmds, [{dir, "repo/c"}]),
+    ok = apply_cmds(GitCmds++DCmds, [{dir, "repo/d"}]),
+    ok = apply_cmds(GitCmds++ECmds, [{dir, "repo/e"}]),
+    ok = apply_cmds(GitCmds++FCmds, [{dir, "repo/f"}]),
+
+    {ok, _} = retest_sh:run("./rebar -v get-deps compile", []),
+    os:cmd("cp a2.rebar.config apps/a1/rebar.config"),
+    {ok, _} = retest_sh:run("./rebar -v update-deps", []),
+    {ok, _} = retest_sh:run("./rebar -v compile", []),
+    os:cmd("cp a3.rebar.config apps/a1/rebar.config"),
+    {ok, _} = retest_sh:run("./rebar -v update-deps", []),
+    {ok, _} = retest_sh:run("./rebar -v compile", []),
+    os:cmd("cp a4.rebar.config apps/a1/rebar.config"),
+    {ok, _} = retest_sh:run("./rebar -v update-deps", []),
+    {ok, _} = retest_sh:run("./rebar -v compile", []),
+    ok.
+
+%%
+%% Generate the contents of a simple .app file
+%%
+app(Name, Modules, Version) ->
+    App = {application, Name,
+           [{description, atom_to_list(Name)},
+            {vsn, Version},
+            {modules, Modules},
+            {registered, []},
+            {applications, [kernel, stdlib]}]},
+    io_lib:format("~p.\n", [App]).

http://git-wip-us.apache.org/repos/asf/couchdb/blob/626455a4/src/rebar/inttest/thooks/fish.erl
----------------------------------------------------------------------
diff --git a/src/rebar/inttest/thooks/fish.erl b/src/rebar/inttest/thooks/fish.erl
new file mode 100644
index 0000000..739cb94
--- /dev/null
+++ b/src/rebar/inttest/thooks/fish.erl
@@ -0,0 +1,5 @@
+-module(fish).
+
+-compile(export_all).
+
+fish() -> fish.

http://git-wip-us.apache.org/repos/asf/couchdb/blob/626455a4/src/rebar/inttest/thooks/rebar.config
----------------------------------------------------------------------
diff --git a/src/rebar/inttest/thooks/rebar.config b/src/rebar/inttest/thooks/rebar.config
new file mode 100644
index 0000000..6514818
--- /dev/null
+++ b/src/rebar/inttest/thooks/rebar.config
@@ -0,0 +1,7 @@
+%% pre-scripts
+{pre_hooks, [{clean, "echo preclean >> preclean.out"},
+             {compile, "echo precompile >> precompile.out"}]}.
+
+%% post-scripts
+{post_hooks, [{clean, "echo postclean >> postclean.out"},
+              {compile, "echo postcompile >> postcompile.out"}]}.