Can RBtools post command generate diff given a list of files?

161 views
Skip to first unread message

Abhishek Choudhary

unread,
Aug 29, 2016, 12:30:47 PM8/29/16
to reviewboard
Hi,

I am using RBtools to post review requests. Currently I have make a local commit (or generate diff file using git diff) and then post a review request. Is there any option that I can use to pass the changed files so that post can generate diff for me.

I tried using -I FILENAME, --include FILENAME from Diff Generation Options but it doesn't seem to work. I get below error:

 File "/u/choudhab/reviewboard/RBenv-2.5/lib/python2.7/site-packages/rbtools/commands/post.py", line 712, in main
    raise CommandError("There don't seem to be any diffs!")
rbtools.commands.CommandError: There don't seem to be any diffs!

rbt post --server 'http://reviewboard.com:7578/' --debug -I urls.py

Is there anything I am doing wrong here?


Thanks,
Abhi

Dunnigan, Terrence J

unread,
Aug 29, 2016, 1:09:11 PM8/29/16
to revie...@googlegroups.com

Have you tried invoking rbt diff?

 

https://www.reviewboard.org/docs/rbtools/dev/rbt/commands/diff/

 

Diff Generation Options

 

Options for choosing what gets included in a diff, and how the diff is generated.

 

--revision-range <rev1:rev2>

 

    Generates a diff for the given revision range.

 

    Deprecated since version 0.6.

 

-I <filename>, --include <filename>

 

    Includes only the specified file in the diff. This can be used multiple times to specify multiple files.

 

    Supported by: Bazaar, CVS, Git, Mercurial, Perforce, and Subversion.

--
Supercharge your Review Board with Power Pack: https://www.reviewboard.org/powerpack/
Want us to host Review Board for you? Check out RBCommons: https://rbcommons.com/
Happy user? Let us know! https://www.reviewboard.org/users/
---
You received this message because you are subscribed to the Google Groups "reviewboard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to reviewboard...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Christian Hammond

unread,
Aug 29, 2016, 2:58:55 PM8/29/16
to revie...@googlegroups.com
Hi Abhishek,

Can you tell me what version of RBTools you're using and what kind of repository this is?

I'd also like to see the full debug output of the command.

Thanks,

Christian 
--
Supercharge your Review Board with Power Pack: https://www.reviewboard.org/powerpack/
Want us to host Review Board for you? Check out RBCommons: https://rbcommons.com/
Happy user? Let us know! https://www.reviewboard.org/users/
---
You received this message because you are subscribed to the Google Groups "reviewboard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to reviewboard+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


--
-- 
Christian Hammond
President/CEO of Beanbag
Makers of Review Board

Abhishek Choudhary

unread,
Aug 30, 2016, 4:04:54 AM8/30/16
to reviewboard, chri...@beanbaginc.com
It is a GIT repository. RBTools version is v0.7.6.

I tried rbt diff --server 'http://reviewboard.com:7578/' --debug  -I urls.py:

>>> RBTools 0.7.6
>>> Python 2.7.11 (default, Apr 25 2016, 09:27:56) 
[GCC 5.2.1 20150902 (Red Hat 5.2.1-2)]
>>> Running on Linux-3.10.0-327.22.2.el7.x86_64-x86_64-with-redhat-7.2-Maipo
>>> Home = /u/choudhab
>>> Current directory = /u/choudhab/django-courses/aip
>>> Checking for a Subversion repository...
>>> Running: svn --non-interactive info
>>> Command exited with rc 1: ['svn', '--non-interactive', u'info']
svn: E155007: '/u/choudhab/django-courses/aip' is not a working copy
---
>>> 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 config --get branch.master.merge
>>> Running: git config --get branch.master.remote
>>> Running: git config --get remote.origin.url
>>> repository info: Path: gitlab:sundars/django-courses.git, Base path: , Supports changesets: False
>>> Making HTTP GET request to http://reviewboard.com:7578/api/
>>> inside http_error_401
>>> retry count: 1
>>> req.get_host() returned reviewboard.com:7578
>>> authGSSClientInit() succeeded
>>> authGSSClientStep() succeeded
>>> authGSSClientResponse() succeeded
>>> cleaning context
[20160830 03:41:17:448 git.py:120 WARNING] Your working directory is not clean. Any changes which have not been committed to a branch will not be included in your review request.


Does RBTools not support generating diff for files not yet committed? The changed files are not yet staged or committed to local copy.

Thanks,
Abhi

Abhishek Choudhary

unread,
Aug 31, 2016, 8:02:13 AM8/31/16
to reviewboard
Any updates? Is this a missing functionality or am i missing something?

David Trowbridge

unread,
Aug 31, 2016, 2:34:11 PM8/31/16
to reviewboard
The -I flag should definitely let you pull out only the changes to a given file when posting for review.

Perhaps you can show us the full command-line you're running, and then also show us the diff of the commit that you're posting?

-David

--
Supercharge your Review Board with Power Pack: https://www.reviewboard.org/powerpack/
Want us to host Review Board for you? Check out RBCommons: https://rbcommons.com/
Happy user? Let us know! https://www.reviewboard.org/users/
---
You received this message because you are subscribed to the Google Groups "reviewboard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to reviewboard...@googlegroups.com.

Abhishek Choudhary

unread,
Sep 1, 2016, 5:26:20 AM9/1/16
to reviewboard
My git status command output:

(RBenv-2.5) ± gs
On branch master
Your branch is up-to-date with 'origin/master'.
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

modified:   settings.py
modified:   urls.py

no changes added to commit (use "git add" and/or "git commit -a")


RBT post command output:

(RBenv-2.5) ± rbt post --server reviewboard.com --debug -I settings.py -I urls.py
>>> RBTools 0.7.6
>>> Python 2.7.11 (default, Apr 25 2016, 09:27:56) 
[GCC 5.2.1 20150902 (Red Hat 5.2.1-2)]
>>> Running on Linux-3.10.0-327.22.2.el7.x86_64-x86_64-with-redhat-7.2-Maipo
>>> Home = /u/choudhab
>>> Current directory = /u/choudhab/django-courses/aip
>>> Checking for a Subversion repository...
>>> Running: svn --non-interactive info
>>> Command exited with rc 1: ['svn', '--non-interactive', u'info']
svn: E155007: '/u/choudhab/django-courses/aip' is not a working copy
---
>>> 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 config --get branch.master.merge
>>> Running: git config --get branch.master.remote
>>> Running: git config --get remote.origin.url
>>> repository info: Path: gitlab:sundars/django-courses.git, Base path: , Supports changesets: False
>>> Making HTTP GET request to http://reviewboard.com/api/
>>> inside http_error_401
>>> retry count: 1
>>> req.get_host() returned reviewboard.com
>>> authGSSClientInit() succeeded
>>> authGSSClientStep() succeeded
>>> authGSSClientResponse() succeeded
>>> cleaning context
[20160901 05:22:20:543 git.py:120 WARNING] Your working directory is not clean. Any changes which have not been committed to a branch will not be included in your review request.
Traceback (most recent call last):
  File "/u/choudhab/reviewboard/RBenv-2.5/bin/rbt", line 44, in <module>
    sys.exit(main())
  File "/u/choudhab/reviewboard/RBenv-2.5/lib/python2.7/site-packages/rbtools/commands/main.py", line 133, in main
    command.run_from_argv([RB_MAIN, command_name] + args)
  File "/u/choudhab/reviewboard/RBenv-2.5/lib/python2.7/site-packages/rbtools/commands/__init__.py", line 629, in run_from_argv
    exit_code = self.main(*args) or 0
  File "/u/choudhab/reviewboard/RBenv-2.5/lib/python2.7/site-packages/rbtools/commands/post.py", line 712, in main
    raise CommandError("There don't seem to be any diffs!")
rbtools.commands.CommandError: There don't seem to be any diffs!


From the debug logs, it looks like for GIT repository this functionality is not supported. I will have to make a local commit for posting diff to review request.

Is this the intended behavior? Should I log a feature request for this, since this seems like a feature to have.

Thanks,
Abhi

David Trowbridge

unread,
Sep 1, 2016, 1:27:38 PM9/1/16
to reviewboard
OK, the issue here is that the files are uncommitted. RBTools with git currently only posts committed changes. If you add them and commit, you can then post only parts of that commit using the -I and -X flags.

There's an unfinished change moldering somewhere to add support for posting changes to the working copy or the index, but it still had some issues.

-David
Reply all
Reply to author
Forward
0 new messages