Suggested fix lp:#213718 (bazaar pager)
Daniel Vedder
d.vedder at web.de
Sun Apr 26 13:03:05 UTC 2015
Hello everyone,
sorry for the long delay. I've been having problems pushing up to
Launchpad for some reason, it always gives me an error.
My branch.conf file shows the following:
parent_location = bzr+ssh://bazaar.launchpad.net/+branch/bzr/
stacked_on_location = bzr+ssh://bazaar.launchpad.net/+branch/bzr
push_location = bzr+ssh://bazaar.launchpad.net/~dvedder95/bzr/pager/
With these settings, using the command 'bzr push --verbose' goes through
all the motions and uploads about 13MB of data, but ends with an error
(shown in the attached screenshot of my terminal window). Does anybody
have an idea what the cause could be?
Until I can fix that, my current changes can be found in the patch.
Greetings,
Daniel
On 13.04.2015 02:44, Richard Wilbur wrote:
> On Sun, Apr 12, 2015 at 2:04 PM, Daniel Vedder <d.vedder at web.de> wrote:
>> OK, I added the BZR_PAGER variable and figured out how to auto-adjust
>> the pager-threshold. Along the way I discovered an undocumented variable
>> BZR_COLUMNS from osutil.py, so I added a documentation entry for it.
> Nice! Thank you for the serendipitous documentation entry.
>
>> @Richard: I couldn't exactly change my previous code to match your
>> suggestions, because Python doesn't seem to support variable assignment
>> inside a test condition:
> You're right. That's why I mentioned I hadn't tested the code. I was
> thinking in a different language at the time. Sorry about that.
>
> The implementation in the latest patch looks like it will overlook the
> first '\n' if it is the first character of text, and otherwise it will
> count one more than the number of lines actually encountered. Here's
> a new suggestion for that section:
>
> + number_of_lines = 0
> + start = text.find("\n")
> + while start > -1:
> + number_of_lines = number_of_lines + 1
> + if number_of_lines > self.pager_cutoff:
> + return True
> + start = text.find("\n", start+1)
> + return False
>
> Sincerely,
> Richard
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bzr-push-error.png
Type: image/png
Size: 54041 bytes
Desc: not available
URL: <https://lists.ubuntu.com/archives/bazaar/attachments/20150426/89da31d7/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bzr-pager4.patch
Type: text/x-patch
Size: 9918 bytes
Desc: not available
URL: <https://lists.ubuntu.com/archives/bazaar/attachments/20150426/89da31d7/attachment-0001.bin>
More information about the bazaar
mailing list