diagrams/diagrams-travis — pull request #1 by bergey (2013-11-12 04:10:52+00:00)
Title: For pull requests, get the source branch name from github

This python script does the right thing testing on my computer. I haven't tested it on travis, for obvious reasons. For example, if travis python is actually python 3, it won't work.

Following @byorgey's suggestion on IRC:
```
so, our travis stuff does the right thing when building branch X
that depends on branch X from another repo (it looks for a branch of
the same name) [22:12]
but it looks like it doesn't do the right thing for pull requests
because when building a pull request it thinks it is building the
branch being merged into rather than the branch being merged from
[22:13]
so it checks out the wrong branch of the dependencies.
byorgey: Ah, bummer. [22:17]
byorgey: Yes, I remember running into that with the lens branches.
we can find out from travis if we are building a pull request (with
the TRAVIS_PULL_REQUEST env var) [22:18]
then we could use the github API to find out the name of the branch
the PR originated from.
seems like a lot of work, but this probably won't be the last time
this situation comes up [22:19]
```