Revert "(#17458) Load 'puppet' at the right time"

Commit b5ed15baadffb22b789cebfab7a76e2ab43c7d14 attempted to require
'puppet' at the right time, but failed. The command_line required puppet
before the application was required and its run_mode determined. As a
result, `puppet master` was using the default :user run_mode, causing
its pidfile to be named 'agent.pid' among other things.

This comit reverts b5ed15ba.
(#17458) Partial revert of "don't rebuild regexp every time"

In commit, 20efe94, a change was made to Puppet::Util.absolute_path? to
require the Puppet module only if necessary. This was done as an
optimization since re-requiring a file is much slower than checking if a
constant is defined.

However, defined?(Puppet) is always true when called within the
Puppet::Util.absolute_path? method, so effectively, absolute_path? would
never require the Puppet module, when previously it used to, in certain
exceptional flows.

In the normal flow, it wasn't an issue, because when puppet runs an
internal subcommand (Application), the app requires the Puppet module,
which loads features, which creates an autoloader, which calls the
absolute_path?  method.  At this point, requiring puppet is not needed.

However, if an external subcommand was specified, e.g.  `puppet foo`,
where `puppet-foo` is an external executable, or if no subcommand was
specified, e.g.  `puppet`, the CommandLine would attempt to resolve the
external subcommand using Puppet::Util.which, which calls absolute_path?
at a time when the Puppet module and features haven't been loaded,
causing #17458.

Ideally, the exceptional cases should be requiring puppet rather than
relying on the absolute_path?  method to do so.  However, in 3.x, this
entire logic has been reworked.  In 3.x, the default confdir/vardir
locations are solely based on whether we're running as root or not, and
not the application's run_mode setting.  As a result, we can and do
require puppet early on.

For 2.7.x, the safest thing is to revert the change in the require
'puppet' behavior.
(#17458) Add acceptance test for executing external subcommands

Commit 20efe94 broke running `puppet` and `puppet-*` external
subcommands. This adds an acceptance test to make sure puppet doesn't
blow up when given an unknown external subcommand.

Paired-with: Josh Cooper <josh@puppetlabs.com>
Merge pull request #1271 from joshcooper/ticket/2.7.x/17458-undo-performance-fix

(#17458) Undo minor performance change in 2.7.x
Update lib/puppet/version.rb for 2.7.20-rc1
Update lib/puppet/version.rb for 2.7.20
(#17820) Avoid allocating and copying hashes unnecessarily

Commit 737c2f66 was implemented to ensure portability with ruby 1.8.5,
but in doing so, it caused severe performance problems, likely due to
allocating a hash, and then merging that, and returning a copy of the
merged hashes.

This commit eliminates the performance issue by not attempting to
merge the hashes, while maintaining compatibility with ruby 1.8.5.

The original code implemented in commit 7002eff7 should be restored in
3.x as that is even faster than this commit, but does not maintain
compatibility with ruby 1.8.5.

Reviewed-by: Josh Cooper <josh@puppetlabs.com>
Merge branch 'ticket/2.7.x/17820-slow-eval-generate' into 2.7.x

* ticket/2.7.x/17820-slow-eval-generate:
  (#17820) Avoid allocating and copying hashes unnecessarily
(#17856) Fix docs re: hasrestart's default value

As part of a docs revision in commit 455c9aab, I put in the wrong default
value for hasrestart, probably after getting it confused with hasstatus.
In fact, it defaults to false. This commit corrects the error.
Merge branch 'nfagerlund-17856_fix_wrong_hasrestart_docs' into 2.7.x

* nfagerlund-17856_fix_wrong_hasrestart_docs:
  (#17856) Fix docs re: hasrestart's default value
Make spec_helper manage tmpdir.

This adds management of the ENV[TMPDIR] when running rspec tests using
spec_helper. Before tests are being run, a temporary directory is
created under the current tmpdir. This temporary directory is then set
as the ENV[TMPDIR].

After all tests have been run, this temporary directory is removed.
The directory is created with the prefix "rspecrun" to easily identify
it in case the spec testing crashes before having cleaned up.

Conflicts:

	spec/spec_helper.rb
(maint) Remove f15 mocks from build_defaults.yaml

Fedora 15 is EOL, and we no longer build packages for f15, so this commit
removes f15 from the list of final and rc mocks in ext/build_defaults.yaml.
Merge pull request #1340 from haus/maint/2.7.x/remove_f15_mocks_from_build_defaults

(maint) Remove f15 mocks from build_defaults.yaml
(maint) Add Travis CI support to active branches

Without this patch all active branches do not have proper Travis configuration
files.  This is a problem because Travis will exercise any branch pushed to the
puppetlabs organization repository on Github.  The default behavior is to email
notifications which is undesirable.

To address this problem Travis configuration settings are added to an active
branch.

Active branches are those that have recent activity when compared against the
following command:

    for k in `git branch -r |grep origin/|perl -pe s/^..//`
    do
      echo -e `git show --pretty=format:"%Cgreen%ci %Cblue%cr%Creset" $k|head -n 1`\\t$k;
    done | sort -r | grep origin

Which should produce output like:

    2013-01-06 02:10:28 -0800 14 hours ago  origin/master
    2013-01-02 16:59:15 -0800 4 days ago    origin/3.0.x
    2012-12-18 10:36:18 -0800 3 weeks ago   origin/2.7.x
    2012-07-09 15:34:04 -0700 6 months ago  origin/2.6.x
    2011-11-03 15:02:03 -0700 1 year, 2 months ago  origin/0.24.x
    2011-10-21 23:15:37 -0700 1 year, 3 months ago  origin/0.25.x
Merge branch 'fix/2.7.x/travis_active_branches' into 2.7.x

* fix/2.7.x/travis_active_branches:
  (maint) Add Travis CI support to active branches