include _test package dependencies (XTestImports)

fixes #56
preserve symlinks when copying
rename to allow for more flags cleanly
avoid off-by-one error in path manipulation

Use library functions for path manipulation. This avoids
an occasional off-by-one error that caused code to be put
in a directory 'rc' instead of 'src'.

fixes #61
new home at https://github.com/tools/godep
new home at https://github.com/tools/godep
use the library for path manipulation

Here we're stripping off an initial 'src' segment from
a relative path. Use the well-tested library function
(and gain error checking!) instead of writing our own.
refactor
remove old code just before copying in new code

It's relatively likely for an error to occur while
loading the dependency list for the given packages. (For
example, if the user doesn't have the go tool in their
search path.) In this case, 'godep save' would delete
the entire Godeps tree before exiting with an error
message.

Now we wait to remove the existing tree until just
before copying in the code. We also do as much as
possible, in particular writing out the new mainfest,
before deleting the old tree.

Fixes #53.
add some unit tests for godep save
test the save function in process

Two benefits:

1. We are guaranteed to be testing the correct logic.
Without this change, the test would pick up whatever
'godep' command is in the path, which isn't necessarily
the same as the code in this directory.

2. Code coverage is now measured.
package args must not appear in dependency list

Previously, if a repo contained packages P and P/Q,
where Q imports P, running 'godep save ./...' would
incorrectly list P as a dependency, even though it
is included in the repo for a package listed on the
command line.

fixes #70
fixes #74
test saving symlinks

ref #57
preserve existing dependency revisions

This changes the default behavior of 'godep save' to
preserve any dependencies already in the list with their
existing revision. New dependencies will be added, and
old dependencies will be removed, but that's all. This
makes the save command roughly analogous to 'go get'
with no flags.

fixes #65
new command: update

This introduces a new command, 'godep update', to update
one or more dependency versions, roughly analogous to
'go get -u'. It is a separate command (rather than
'godep save -u') because the package argument is
different: it specifies a dependency rather than a
top-level package.
slightly more readable test error log
fix spurious error message saving sibling packages

When carrying forward existing versions, we would scan
through the whole list looking for exact matches - which
need to reuse the version from the old list - and child
or sibling packages - which can't carry over the old
version and require both old and new entries to match.
Since we can't handle mixing versions between packages
from a single repo, a mismatch there is reported as an
error.

However, it's possible for both cases to occur
simultaneously, an exact match as well as a sibling
relationship, if the user is importing both D/A and D/B
(but not D). This would cause a newer version present in
the filesystem to be reported as an error when the
existing version could be safely carried forward. We now
prioritize the exact match and break out of the check
early when we find such a match.

fixes #85
save: new flag -r to rewrite import paths

One drawback of godep's previous default behavior is
that repos using it cease to be 'go gettable'. This is a
big problem because it impacts a lot of people: not just
the repo's developers, but also its users.

Flag -r solves this by rewriting import paths to refer
directly to the copied source code at its new location.
So a package C that depends on package D will actually
import C/Godeps/_workspace/src/D. This makes C's repo
self-contained and causes 'go get' to build C with the
right version of all dependencies.

fixes #68
findInParents didn't check Windows root folders
save: test more implementation corner cases

Add two more tests in preparation for #99.

Check that a dependency and transitive dependency are
correctly copied in place from separate gopath roots. If
dependency D is in root1/src/D, and T is in root2/src/T,
and D depends on T, make sure that both D and T can be
found and copied into the current package.

Also check that we properly exclude subdirectories of
dependencies even when the subdirectory is obtained as a
rewritten import path from another dependency. If we
depend on D and T, and D depends on T/X (rewritten as
D/Godeps/_workspace/src/T/X), list only T in our
manifest, not T/X.