Fixes associated to Issue 1345
Fixes associated to Issue 1345

Patch from Laurent Nicolas. post-review does not process a *pending* Perforce
changeset in v0.2 beta3 (Note that it is a regression from v0.2 beta2).

Also 2 changes that are not strictly related:
1) allow *pending* to be on the second line in addition to the first line
2) append the list of bugs to existing list if it exists already rather than
overwritting it.

Note the "view diffs" view does not show a white space change on line 1586.  I
fixed the indentation, otherwise the for loop was ending after the first line.

Testing done:
Tested post-review against our perforce repository, using two *pending*
changeset. Tried combination of with and without -r to find existing review
based on changeset number or review id.  Added bug list to check append feature.

Checked for different values of --bugs-closed.  After each invocation, checked
the GUI for a correct list, and then submitted the review before the next try:

1) No option

Bugs: empty

2) --bugs-closed=123

Bugs: 123

3) --bugs-closed=456

Bugs: 123, 456

4) --bugs-closed=456 (repeat)

Bugs: 123, 456

5) --bugs-closed=12

Bugs: 12, 123, 456

6) --bugs-closed=1234

Bugs: 12, 123, 456, 1234

7) --bugs-closed="1234, 12345, 1,"

Bugs: 1, 12, 123, 456, 1234, 12345

8) --bugs-closed="1,,   234, 12345, 1, ,,"

Bugs: 1, 123, 234, 456, 1234, 12345

10) --bugs-closed="  ,,   ,,1,,   234, 12345, 1, ,, , , ,,,,   ,,,,,"

Bugs: 1, 12, 123, 234, 456, 1234, 12345

Checked the database: Bugs field: 1234,12,456,1,123,234,12345

Fixes bug 1345

clach04/old_rbtools_0.3.2,halvorlu/rbtools,Khan/rbtools,datjwu/rbtools,davidt/rbtools,bcelary/rbtools,blair/pkg-rbtools,halvorlu/rbtools,datjwu/rbtools,clach04/rbtools,davidt/rbtools,haosdent/rbtools,Khan/rbtools,beol/rbtools,halvorlu/rbtools,reviewboard/rbtools,beol/rbtools,1tush/rbtools,davidt/rbtools,beol/rbtools,reviewboard/rbtools,datjwu/rbtools,clach04/rbtools_0.4.1,haosdent/rbtools,reviewboard/rbtools,haosdent/rbtools