Running version-info fails when there is no work tree
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Breezy |
Fix Released
|
Low
|
Jelmer Vernooij |
Bug Description
Have some legacy tooling that need to run Bazaar like this on a shared repo without a worktree. Caveat for if I don't get the terminology quite right.
----
$ bzr version-info --all /path/to/
Traceback (most recent call last):
File "/opt/breezy/
return the_callable(*args, **kwargs)
File "/opt/breezy/
ret = run(*run_argv)
File "/opt/breezy/
return self.run(
File "/opt/breezy/
return class_run(*args, **kwargs)
File "/opt/breezy/
builder.
File "/opt/breezy/
self.
File "/opt/breezy/
basis_tree = self._working_
AttributeError: 'NoneType' object has no attribute 'basis_tree'
brz 3.2.2 on python 3.6.8 (Linux-
redhat-
arguments: ['/bin/bzr', 'version-info', '--all', '/path/
plugins: bash_completion
commitfromn
fastimport[
gitlab[3.2.2], hg[3.2.2], launchpad[3.2.2], mtn[3.2.2],
netrc_
propose[3.2.2], pypi[3.2.2], quilt[unknown], repodebug[3.2.2],
rewrite[
weave_
encoding: 'utf-8', fsenc: 'utf-8', lang: 'en_US.UTF-8'
*** Bazaar has encountered an internal error. This probably indicates a
bug in Bazaar. You can help us fix it by filing a bug report at
https:/
including this traceback and a description of the problem.
----
For now I'm using this patch, which seems to be working so far:
----
diff -Naru breezy-
--- breezy-
+++ breezy-
@@ -89,6 +89,9 @@
def _extract_
"""Extract the working revisions for all files"""
+ if self._working_tree is None:
+ return None
+
# Things seem clean if we never look :)
----
Submitting this here as a suggested change, as it seems to make sense that if there is no worktree, there is no need to inspect any files in it.
Related branches
- Jelmer Vernooij: Approve
-
Diff: 82 lines (+29/-14)2 files modifiedbreezy/tests/test_version_info.py (+15/-0)
breezy/version_info_formats/__init__.py (+14/-14)
Changed in brz: | |
status: | New → Fix Committed |
importance: | Undecided → Low |
assignee: | nobody → Jelmer Vernooij (jelmer) |
milestone: | none → 3.3.3 |
Changed in brz: | |
status: | Fix Committed → Fix Released |
Jelmer, thanks for the quick response!