4628: rbt patch --print cannot be run outside of a source tree

alexander

What version are you running?

0.7.10

What steps will reproduce the problem?

Run rbt patch --print outside of a source tree.

What is the expected output? What do you see instead?

According to 0.7.8 patch notes:
"rbt patch --print can now be run outside of a source tree."
Expected to fetch latest diff. Instead I get:
"ERROR: The current directory does not contain a checkout from a supported source code repository."

What operating system are you using?

Debian 8.3

Attach the debug out from the command.

$ rbt patch -d --print 906
>>> RBTools 0.7.10
>>> Python 2.7.9 (default, Mar  1 2015, 12:57:24)
[GCC 4.9.2]
>>> Running on Linux-3.16.0-4-amd64-x86_64-with-debian-8.3
>>> Home = /home/admin
>>> Current directory = /home/admin
>>> Command line: rbt patch -d --print 906
>>> Running: tf vc help
>>> Checking for a Subversion repository...
>>> Running: svn --non-interactive info
>>> Command exited with rc 1: ['svn', '--non-interactive', u'info']
svn: E155007: '/home/admin' is not a working copy
---
>>> Checking for a Git repository...
>>> Running: git rev-parse --git-dir
>>> Command exited with rc 128: ['git', 'rev-parse', '--git-dir']
fatal: Not a git repository (or any of the parent directories): .git
---
>>> Checking for a Mercurial repository...
>>> Unable to execute "hg --help": skipping Mercurial
>>> Checking for a CVS repository...
>>> Unable to execute "cvs": skipping CVS
>>> Checking for a Perforce repository...
>>> Unable to execute "p4 help": skipping Perforce
>>> Checking for a Plastic repository...
>>> Unable to execute "cm version": skipping Plastic
>>> Checking for a ClearCase repository...
>>> Unable to execute "cleartool help": skipping ClearCase
>>> Checking for a Bazaar repository...
>>> Unable to execute "bzr help": skipping Bazaar
>>> Checking for a Team Foundation Server repository...
>>> Unable to execute "tf help": skipping TFS
ERROR: The current directory does not contain a checkout from a supported source code repository.
david
#1 david

The issue here is that it doesn't know what server to connect to, so it's trying to autodetect it based on your working directory. If you specify --server or put a REVIEWBOARD_URL in ~/.reviewboardrc, you'll be able to use "rbt patch" without needing a local checkout.

We can try to improve the output in this case.

  • +BetterErrors
    +EasyFix
#2 jshephard

I'll look into this