4037: perforce.py returns TypeError exception if changelist has deleted symlink

akiskall

What version are you running?

0.7.5

What steps will reproduce the problem?

  1. Use perforce as SCM
  2. Create a pending changelist with a deleted symlink
  3. Try to create a review

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

The expected output would be to create the review with no errors.

The actual output is this:

Generating diff for pending changeset 205103
Traceback (most recent call last):
File "/usr/lib/python2.7/logging/init.py", line 859, in emit
msg = self.format(record)
File "/usr/lib/python2.7/logging/init.py", line 732, in format
return fmt.format(record)
File "/usr/lib/python2.7/logging/init.py", line 471, in format
record.message = record.getMessage()
File "/usr/lib/python2.7/logging/init.py", line 335, in getMessage
msg = msg % self.args
TypeError: not enough arguments for format string
Logged from file perforce.py, line 620
Review request #51441 posted.

http://reviews.bytemobile.com/r/51441/
http://reviews.bytemobile.com/r/51441/diff/

The review is actually posted but you get this unwanted exception.

What operating system are you using?

Tested on RHEL 6.5 and Arch Linux.

Attach the debug out from the command.

>>> RBTools 0.7.5
>>> Python 2.7.10 (default, Sep  7 2015, 13:51:49) 
[GCC 5.2.0]
>>> Running on Linux-4.3.0-1-ck-x86_64-with-glibc2.2.5
>>> Home = /home/kallige
>>> Current directory = /home/kallige/workspace/perforce/ikalligeros.fusion.main.dell
>>> Checking for a Perforce repository...
>>> Running: p4 info
>>> Running: diff --version
>>> repository info: Path: perforce:1666, Base path: None, Supports changesets: True
>>> Running: p4 counters
>>> Making HTTP GET request to http://reviews.bytemobile.com/api/
>>> Running: p4 info
Generating diff for pending changeset 205103
>>> Processing delete of //depot/fusion/main/os/asm/etc/rc.d/init.d/vmwaretools
>>> Writing "//depot/fusion/main/os/asm/etc/rc.d/init.d/vmwaretools#1" to "/tmp/tmpjDtM5g"
>>> Running: p4 print -o /tmp/tmpjDtM5g -q //depot/fusion/main/os/asm/etc/rc.d/init.d/vmwaretools#1
>>> Running: diff -urNp /tmp/tmpjDtM5g /tmp/tmpoE9j3S
>>> Command exited with rc 1: [u'diff', u'-urNp', '/tmp/tmpjDtM5g', '/tmp/tmpoE9j3S']
>>> Processing delete of //depot/fusion/main/os/asm/etc/systemd/system/runlevel3.target.wants/vmwaretools.service
>>> Writing "//depot/fusion/main/os/asm/etc/systemd/system/runlevel3.target.wants/vmwaretools.service#1" to "/tmp/tmpqWFXWC"
>>> Running: p4 print -o /tmp/tmpqWFXWC -q //depot/fusion/main/os/asm/etc/systemd/system/runlevel3.target.wants/vmwaretools.service#1
Traceback (most recent call last):
  File "/usr/lib/python2.7/logging/__init__.py", line 859, in emit
    msg = self.format(record)
  File "/usr/lib/python2.7/logging/__init__.py", line 732, in format
    return fmt.format(record)
  File "/usr/lib/python2.7/logging/__init__.py", line 471, in format
    record.message = record.getMessage()
  File "/usr/lib/python2.7/logging/__init__.py", line 335, in getMessage
    msg = msg % self.args
TypeError: not enough arguments for format string
Logged from file perforce.py, line 617
>>> Processing delete of //depot/fusion/main/os/asm/usr/lib/systemd/system/vmwaretools.service
>>> Writing "//depot/fusion/main/os/asm/usr/lib/systemd/system/vmwaretools.service#1" to "/tmp/tmpg_cVOT"
>>> Running: p4 print -o /tmp/tmpg_cVOT -q //depot/fusion/main/os/asm/usr/lib/systemd/system/vmwaretools.service#1
>>> Running: diff -urNp /tmp/tmpg_cVOT /tmp/tmpr54lY6
>>> Command exited with rc 1: [u'diff', u'-urNp', '/tmp/tmpg_cVOT', '/tmp/tmpr54lY6']
>>> Processing edit of //depot/fusion/main/release/packaging/csm/csm-package-def.sh
>>> Writing "//depot/fusion/main/release/packaging/csm/csm-package-def.sh#294" to "/tmp/tmpYjnTbv"
>>> Running: p4 print -o /tmp/tmpYjnTbv -q //depot/fusion/main/release/packaging/csm/csm-package-def.sh#294
>>> Running: diff -urNp /tmp/tmpYjnTbv /home/kallige/workspace/perforce/ikalligeros.fusion.main.dell/fusion/release/packaging/csm/csm-package-def.sh
>>> Command exited with rc 1: [u'diff', u'-urNp', '/tmp/tmpYjnTbv', '/home/kallige/workspace/perforce/ikalligeros.fusion.main.dell/fusion/release/packaging/csm/csm-package-def.sh']
>>> Making HTTP GET request to http://reviews.bytemobile.com/api/validation/diffs/
>>> Making HTTP POST request to http://reviews.bytemobile.com/api/validation/diffs/
>>> Making HTTP GET request to http://reviews.bytemobile.com/api/review-requests/?only-links=create&only-fields=
>>> Making HTTP POST request to http://reviews.bytemobile.com/api/review-requests/
>>> Got API Error 204 (HTTP code 409): The commit ID specified has already been used.
>>> Error data: {u'stat': u'fail', u'review_request': {u'status': u'pending', u'last_updated': u'2015-12-10T12:43:35Z', u'target_people': [], u'depends_on': [], u'description_text_type': u'plain', u'issue_resolved_count': 0, u'ship_it_count': 0, u'close_description_text_type': u'plain', u'id': 51441, u'description': u'Dummy \n', u'links': {u'diffs': {u'href': u'http://reviews.bytemobile.com/api/review-requests/51441/diffs/', u'method': u'GET'}, u'repository': {u'href': u'http://reviews.bytemobile.com/api/repositories/1/', u'method': u'GET', u'title': u'perforce'}, u'changes': {u'href': u'http://reviews.bytemobile.com/api/review-requests/51441/changes/', u'method': u'GET'}, u'self': {u'href': u'http://reviews.bytemobile.com/api/review-requests/51441/', u'method': u'GET'}, u'update': {u'href': u'http://reviews.bytemobile.com/api/review-requests/51441/', u'method': u'PUT'}, u'last_update': {u'href': u'http://reviews.bytemobile.com/api/review-requests/51441/last-update/', u'method': u'GET'}, u'reviews': {u'href': u'http://reviews.bytemobile.com/api/review-requests/51441/reviews/', u'method': u'GET'}, u'draft': {u'href': u'http://reviews.bytemobile.com/api/review-requests/51441/draft/', u'method': u'GET'}, u'file_attachments': {u'href': u'http://reviews.bytemobile.com/api/review-requests/51441/file-attachments/', u'method': u'GET'}, u'submitter': {u'href': u'http://reviews.bytemobile.com/api/users/ikalligeros/', u'method': u'GET', u'title': u'ikalligeros'}, u'delete': {u'href': u'http://reviews.bytemobile.com/api/review-requests/51441/', u'method': u'DELETE'}, u'screenshots': {u'href': u'http://reviews.bytemobile.com/api/review-requests/51441/screenshots/', u'method': u'GET'}, u'diff_context': {u'href': u'http://reviews.bytemobile.com/api/review-requests/51441/diff-context/', u'method': u'GET'}}, u'changenum': 205103, u'bugs_closed': [], u'testing_done_text_type': u'plain', u'testing_done': u'', u'close_description': None, u'time_added': u'2015-12-10T12:43:35Z', u'extra_data': {}, u'public': False, u'commit_id': u'205103', u'blocks': [], u'branch': u'', u'text_type': None, u'issue_open_count': 0, u'approved': False, u'url': u'/r/51441/', u'absolute_url': u'http://reviews.bytemobile.com/r/51441/', u'target_groups': [], u'summary': u'Dummy ', u'issue_dropped_count': 0, u'approval_failure': u'The review request has not been marked "Ship It!"'}, u'err': {u'msg': u'The commit ID specified has already been used.', u'code': 204}}
>>> Making HTTP GET request to http://reviews.bytemobile.com/api/review-requests/51441/?only-links=diffs%2Cdraft&only-fields=absolute_url%2Cbugs_closed%2Cid%2Cstatus
>>> Making HTTP PUT request to http://reviews.bytemobile.com/api/review-requests/51441/
>>> Making HTTP GET request to http://reviews.bytemobile.com/api/review-requests/51441/diffs/?only-fields=
>>> Making HTTP POST request to http://reviews.bytemobile.com/api/review-requests/51441/diffs/
>>> Making HTTP GET request to http://reviews.bytemobile.com/api/review-requests/51441/draft/?only-fields=commit_id
>>> Fetching description for changelist 205103
>>> Making HTTP PUT request to http://reviews.bytemobile.com/api/review-requests/51441/draft/
Review request #51441 posted.

http://reviews.bytemobile.com/r/51441/
http://reviews.bytemobile.com/r/51441/diff/

Please provide any additional information below.

#1 akiskall

A fix is ready for this one.

david
#2 david

Fixed in release-0.7.x (0279699). This will ship in 0.7.6. Thanks!

  • -New
    +Fixed