4766: rbt post regression with git svn when using single revision not immediately after remotes/svn/trunk


What version are you running?

RBTools 1.0.1

What steps will reproduce the problem?

  1. Using a git-svn repo, create two commits in the local git repo and do not push them to the remote svn
  2. Execute rbt post HEAD to only create a review for the latest commit.

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

Failure with the following message:

Type Error: object of type 'NoneType' has no len()

What operating system are you using?

CentOS 7, with git version 2.18.0

Please provide any additional information below.

The last time this worked was with RBTools version 0.7.11.

#1 david

Can you run with --debug and post the output here?

  • -New
#2 splatter2

Here is some sample output from the rbt post command:

>>> RBTools 1.0.1
>>> Python 3.6.7 (default, Nov 14 2018, 20:21:14)
[GCC 5.4.0 20160609]
>>> Running on Linux-3.10.0-862.14.4.el7.x86_64-x86_64-with-debian-stretch-sid
>>> Home = /home/user
>>> Current directory = /projects/test/repo1-git
>>> Command line: rbt post -d --server http://demo.reviewboard.org/ HEAD
>>> Running: tf vc help
>>> Checking for a Bazaar repository...
>>> Unable to execute "bzr help": skipping Bazaar
>>> Checking for a ClearCase repository...
>>> Unable to execute "cleartool help": skipping ClearCase
>>> Checking for a CVS repository...
>>> Unable to execute "cvs": skipping CVS
>>> 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: file:///projects/test/svn/repo1, Base path: /, Supports changesets: False
>>> Checking for a Mercurial repository...
>>> Unable to execute "hg --help": skipping Mercurial
>>> 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 Subversion repository...
>>> Running: svn --non-interactive info
>>> Command exited with rc 1: ['svn', '--non-interactive', 'info']
>>> Checking for a Team Foundation Server repository...
>>> Unable to execute "tf help": skipping TFS
>>> Making HTTP GET request to http://demo.reviewboard.org/api/
>>> Making HTTP GET request to http://demo.reviewboard.org/api/repositories/?tool=Subversion
>>> Cached response for HTTP GET http://demo.reviewboard.org/api/repositories/?tool=Subversion expired and was modified
>>> Running: git rev-parse HEAD
>>> Running: git rev-parse 79c6bc68ecd118cc35b2d88cb7934bbbfd0cde59^
>>> Running: git rev-list --not --remotes=origin 069c7cac4d0e6eb3c7b47a0b564a15d0020b9afb
>>> Running: git version
>>> Running: git -c core.quotepath=false diff --no-color --no-prefix -r -u --no-ext-diff 069c7cac4d0e6eb3c7b47a0b564a15d0020b9afb..79c6bc68ecd118cc35b2d88cb7934bbbfd0cde59
>>> Running: git svn find-rev 069c7cac4d0e6eb3c7b47a0b564a15d0020b9afb
Traceback (most recent call last):
  File "/home/user/.pyenv/versions/general/bin/rbt", line 11, in <module>
  File "/home/user/.pyenv/versions/3.6.7/envs/general/lib/python3.6/site-packages/rbtools/commands/main.py", line 120, in main
    command.run_from_argv([RB_MAIN, command_name] + args)
  File "/home/user/.pyenv/versions/3.6.7/envs/general/lib/python3.6/site-packages/rbtools/commands/__init__.py", line 719, in run_from_argv
    exit_code = self.main(*args) or 0
  File "/home/user/.pyenv/versions/3.6.7/envs/general/lib/python3.6/site-packages/rbtools/commands/post.py", line 813, in main
    logging.debug('Generated diff size: %d bytes', len(diff))
TypeError: object of type 'NoneType' has no len()

Here is the output of git log on my test repo to show the structure of the repository:

commit 79c6bc68ecd118cc35b2d88cb7934bbbfd0cde59 (HEAD -> master)
Author: Your Name <test@example.com>
Date:   Wed Nov 14 17:36:55 2018 +0000

    git commit 2

commit 069c7cac4d0e6eb3c7b47a0b564a15d0020b9afb
Author: Your Name <test@example.com>
Date:   Wed Nov 14 17:34:06 2018 +0000

    git commit 1

commit 2feeef606e97f6bd52d92880ff67a8066bef3cf6 (git-svn)
Author: user <user@46007809-88b3-48b5-989f-fa5e40f080ea>
Date:   Wed Nov 14 17:31:40 2018 +0000

    Seond commit

    git-svn-id: file:///projects/test/svn/repo1@2 46007809-88b3-48b5-989f-fa5e40f080ea

commit 5937dcce86ca757687a863744919fec5642118f0
Author: user <user@46007809-88b3-48b5-989f-fa5e40f080ea>
Date:   Wed Nov 14 17:31:12 2018 +0000

    Initial commit

    git-svn-id: file:///projects/test/svn/repo1@1 46007809-88b3-48b5-989f-fa5e40f080ea

Also note that I am using a patched version of rbt in order to fix issue #4728. I have patched rbtools/clients/git.py as follows:

<             [self.git, 'rev-list', local_branch, '--not',
<              '--remotes=%s' % remote])
>             [self.git, 'rev-list', '--not',
>              '--remotes=%s' % remote, local_branch])
#3 david

That patch isn't correct. The --not argument to rev-list affects all revision specifiers that come after it, up until the next --not. You might be able to use --not --remotes=<remote> --not local_branch but that's just a more complicated way of doing what it was doing before.

#4 splatter2

My apologies, you are correct. The issue was caused by my incorrect patch. My real issue was issue #4728. I had been using a non-standard name for my svn remote (svn instead of origin), which caused me to hit #4728. I reverted my patch and changed the name of the svn remote to origin and not it all works. See my comments to #4728 for more information regarding that issue.