Merge lp://qastaging/~florian-rathgeber/bzr-externals/fix-deprecated-split-lp-911999 into lp://qastaging/bzr-externals

Proposed by Florian Rathgeber
Status: Merged
Merged at revision: 49
Proposed branch: lp://qastaging/~florian-rathgeber/bzr-externals/fix-deprecated-split-lp-911999
Merge into: lp://qastaging/bzr-externals
Diff against target: 24 lines (+4/-3)
1 file modified
externals.py (+4/-3)
To merge this branch: bzr merge lp://qastaging/~florian-rathgeber/bzr-externals/fix-deprecated-split-lp-911999
Reviewer Review Type Date Requested Status
Eugene Tarasenko Needs Fixing
Review via email: mp+87540@code.qastaging.launchpad.net

Description of the change

The 'shlex_split_unicode' method in 'bzrlib.commands' used in bzr-externals is deprecated as of bzr 2.2.0 and has been removed in the recent development version of bzr, causing the plugin to crash with:

  bzr: ERROR: exceptions.ImportError: cannot import name shlex_split_unicode

This is a simple fix: replace 'shlex_split_unicode' with 'cmdline.split' (also from 'bzrlib.commands').

To post a comment you must log in.
Revision history for this message
Eugene Tarasenko (etarasenko) wrote :
Download full text (5.0 KiB)

$ bzr init main
Created a standalone tree (format: 2a)
$ bzr init sub1
Created a standalone tree (format: 2a)
$ cd main/
$ bzr eadd ../sub1 sub1
Add external branch ../sub1 sub1
Branched 0 revision(s).
adding .bzrignore
adding .bzrmeta
adding .bzrmeta/externals
adding .bzrmeta/externals-snapshot

$ bzr ci -m "Add sub1"
Committing to: /home/etarasenko/projects/bzr-externals/main/
added .bzrignore
added .bzrmeta
added .bzrmeta/externals
added .bzrmeta/externals-snapshot
bzr: ERROR: bzrlib.errors.IllegalUseOfScopeReplacer: ScopeReplacer object 'cmdline' was used incorrectly: Object already cleaned up, did you assign it to another variable?: _factory

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/bzrlib/commands.py", line 946, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/bzrlib/commands.py", line 1150, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.7/dist-packages/bzrlib/commands.py", line 699, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/lib/python2.7/dist-packages/bzrlib/commands.py", line 721, in run
    return self._operation.run_simple(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/bzrlib/cleanup.py", line 135, in run_simple
    self.cleanups, self.func, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/bzrlib/cleanup.py", line 165, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/bzrlib/builtins.py", line 3316, in run
    lossy=lossy)
  File "/usr/lib/python2.7/dist-packages/bzrlib/decorators.py", line 217, in write_locked
    result = unbound(self, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/bzrlib/workingtree_4.py", line 209, in commit
    result = WorkingTree.commit(self, message, revprops, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/bzrlib/decorators.py", line 217, in write_locked
    result = unbound(self, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/bzrlib/mutabletree.py", line 210, in commit
    *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/bzrlib/commit.py", line 289, in commit
    lossy=lossy)
  File "/usr/lib/python2.7/dist-packages/bzrlib/cleanup.py", line 131, in run
    self.cleanups, self.func, self, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/bzrlib/cleanup.py", line 165, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/bzrlib/commit.py", line 462, in _commit
    self.branch.set_last_revision_info(new_revno, self.rev_id)
  File "/usr/lib/python2.7/dist-packages/bzrlib/decorators.py", line 217, in w...

Read more...

review: Needs Fixing
50. By Florian Rathgeber

Directly import split from bzrlib.cmdline to properly work with lazy_import.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches