4931: git-svn repos should not need a remote

jcaplan

What version are you running?

RBTools 2.0 (Python 2.7.18)

What steps will reproduce the problem?

clone an svn repository with git-svn
post to a reviewboard configured with the svn repository from the local git-svn

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

The review should get created. Instead there is an error that the remote cannot be found.

 rbt post     
CRITICAL: This clone has no configured remotes.

There's no reason to need a remote in this case. If I create a bare clone locally and point to it as a remote then the review is created. This workaround should not be necessary.

What operating system are you using?

Ubuntu 20.04

Attach the debug out from the command.

tes.
➜  /ws/io-sock/mainline (fd/COREOS-119975) rbt post --debug        
>>> RBTools 2.0
>>> Python 2.7.18 (default, Mar  8 2021, 13:02:45) 
[GCC 9.3.0]
>>> Running on Linux-5.4.0-74-generic-x86_64-with-Ubuntu-20.04-focal
>>> Home = /home/jcaplan
>>> Current directory = /ws/io-sock/mainline
>>> Command line: rbt post --debug
>>> Running: tf vc help
>>> Checking for a Subversion repository...
>>> Running: svn --non-interactive info
>>> Command exited with rc 1: [u'svn', u'--non-interactive', u'info']
>>> Checking for a Git repository...
>>> Running: git rev-parse --git-dir
>>> Running: git config core.bare
>>> Running: git rev-parse --show-toplevel
>>> Running: git symbolic-ref -q HEAD
>>> Running: git svn info
>>> Repository info: Path: http://f27svn.qnx.com/svn/repos/osr, Base path: /trunk, Supports changesets: False
>>> 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
>>> Making HTTP GET request to http://bts-reviewboard.bts.rim.net/api/
>>> Making HTTP GET request to https://bts-reviewboard.bts.rim.net/api/repositories/?tool=Subversion
>>> Cached response for HTTP GET https://bts-reviewboard.bts.rim.net/api/repositories/?tool=Subversion expired and was modified
>>> Running: git rev-parse refs/heads/fd/COREOS-119975
>>> Running: git svn rebase -n
>>> Running: git branch --remotes
>>> Running: git config --get branch.refs/remotes/git-svn.remote
>>> Command exited with rc 1: [u'git', u'config', u'--get', u'branch.refs/remotes/git-svn.remote']
---
>>> Running: git remote
Traceback (most recent call last):
  File "/home/jcaplan/.local/bin/rbt", line 8, in <module>
    sys.exit(main())
  File "/home/jcaplan/.local/lib/python2.7/site-packages/rbtools/commands/main.py", line 124, in main
    command.run_from_argv([RB_MAIN, command_name] + args)
  File "/home/jcaplan/.local/lib/python2.7/site-packages/rbtools/commands/__init__.py", line 770, in run_from_argv
    exit_code = self.main(*args) or 0
  File "/home/jcaplan/.local/lib/python2.7/site-packages/rbtools/commands/post.py", line 1014, in main
    self.revisions = get_revisions(self.tool, self.cmd_args)
  File "/home/jcaplan/.local/lib/python2.7/site-packages/rbtools/utils/review_request.py", line 68, in get_revisions
    revisions = tool.parse_revision_spec(cmd_args)
  File "/home/jcaplan/.local/lib/python2.7/site-packages/rbtools/clients/git.py", line 157, in parse_revision_spec
    remote = self._find_remote(parent_branch)
  File "/home/jcaplan/.local/lib/python2.7/site-packages/rbtools/clients/git.py", line 1515, in _find_remote
    raise SCMError('This clone has no configured remotes.')
rbtools.clients.errors.SCMError: This clone has no configured remotes.

Please provide any additional information below.