brz diff --using does not work with colordiff
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Breezy |
Fix Released
|
Medium
|
Jelmer Vernooij |
Bug Description
When using "brz diff --using=colordiff", I get mangled output. When using "brz diff | colordiff", everything works correctly. So, --using seems to pass the data through in a different format, which colordiff fails to parse correctly:
Mangled output:
> brz diff --using=colordiff
=== modified file 'web/common.py'
25d24
< from web.utils.
=== modified file 'web/translatio
1016a1017,1035
> #: web/templates/
> msgid "Do you see an error?"
> msgstr ""
>
> #: web/templates/
> msgid ""
> "If your version of Chrome is disabling the plugin and showing you a "
> "message similar to the one shown here, you will need to download and "
> "install the alternative version of Kopernio plugin .crx file."
> msgstr ""
>
> #: web/templates/
> msgid "Download the alternative version"
> msgstr ""
>
> #: web/templates/
> msgid "Then repeat steps 2 to 5."
> msgstr ""
>
=== removed file 'web/utils/
--- old/web/
+++ new/web/
@@ -1,34 +0,0 @@
-import pytest
-
-import web
-from web.utils.
-
-BASE_CASE = "fr-CH"
-HAS_COMMA = "fr-CH,"
-LIST = "fr-CH, fr-CB"
-
-
-@pytest.fixture()
-def client():
- app = web.app
- app.config[
- app.config[
- yield app.test_client()
-
-
-@pytest.
-def test_ua_
- app = web.app
- with app.test_
- client.get()
- assert UA_languages() == ["fr"]
-
-
-def test_ua_
- app = web.app
- ua_languages_str = "fr-CH, zh-TT"
- with app.test_
- client.get()
- assert "fr" in UA_languages()
- assert "zh" in UA_languages()
- assert "tt" not in UA_languages()
=== removed file 'web/utils/
--- old/web/
+++ new/web/
@@ -1,22 +0,0 @@
-from flask import request
-
-
-def UA_languages():
- """
- This returns a list of languages without the locale
- :return: list of strings
- """
-
- # retrieve the languages as a list from the request header
- languages = request.
-
- # remove spaces
- cleaned = list(map(lambda item: item.strip(), languages))
-
- # remove empty list items
- cleaned = [item for item in cleaned if item]
-
- # strip the locale
- cleaned = [language_
-
- return list(set(cleaned))
Correct version:
> brz diff | colordiff
=== modified file 'web/common.py'
--- old/web/common.py 2019-10-03 11:13:31 +0000
+++ new/web/common.py 2019-10-03 11:21:06 +0000
@@ -22,7 +22,6 @@
from web.settings import CHROME_EXTENSIONID
from web.utils.ab_test import ABTestView, ABTestCase, abtest_analytics, ab_test, ab_finished
from web.utils.i18n import get_available_
-from web.utils.
# Configure babel
babel = Babel(app)
=== modified file 'web/translatio
--- old/web/
+++ new/web/
@@ -1014,6 +1014,25 @@
msgid "Select your institution and create a free Kopernio account"
msgstr "选择您的组织机构,
+#: web/templates/
+msgid "Do you see an error?"
+msgstr ""
+
+#: web/templates/
+msgid ""
+"If your version of Chrome is disabling the plugin and showing you a "
+"message similar to the one shown here, you will need to download and "
+"install the alternative version of Kopernio plugin .crx file."
+msgstr ""
+
+#: web/templates/
+msgid "Download the alternative version"
+msgstr ""
+
+#: web/templates/
+msgid "Then repeat steps 2 to 5."
+msgstr ""
+
#: web/templates/
msgid "Click to see your newly installed Kopernio button in action!"
msgstr "单击观看新安装的Kopern
=== removed file 'web/utils/
--- old/web/
+++ new/web/
@@ -1,34 +0,0 @@
-import pytest
-
-import web
-from web.utils.
-
-BASE_CASE = "fr-CH"
-HAS_COMMA = "fr-CH,"
-LIST = "fr-CH, fr-CB"
-
-
-@pytest.fixture()
-def client():
- app = web.app
- app.config[
- app.config[
- yield app.test_client()
-
-
-@pytest.
-def test_ua_
- app = web.app
- with app.test_
- client.get()
- assert UA_languages() == ["fr"]
-
-
-def test_ua_
- app = web.app
- ua_languages_str = "fr-CH, zh-TT"
- with app.test_
- client.get()
- assert "fr" in UA_languages()
- assert "zh" in UA_languages()
- assert "tt" not in UA_languages()
=== removed file 'web/utils/
--- old/web/
+++ new/web/
@@ -1,22 +0,0 @@
-from flask import request
-
-
-def UA_languages():
- """
- This returns a list of languages without the locale
- :return: list of strings
- """
-
- # retrieve the languages as a list from the request header
- languages = request.
-
- # remove spaces
- cleaned = list(map(lambda item: item.strip(), languages))
-
- # remove empty list items
- cleaned = [item for item in cleaned if item]
-
- # strip the locale
- cleaned = [language_
-
- return list(set(cleaned))
Related branches
- Jelmer Vernooij: Approve
-
Diff: 45 lines (+14/-0)3 files modifiedbreezy/diff.py (+2/-0)
breezy/tests/test_diff.py (+9/-0)
doc/en/release-notes/brz-3.1.txt (+3/-0)
- Jelmer Vernooij: Approve
-
Diff: 45 lines (+14/-0)3 files modifiedbreezy/diff.py (+2/-0)
breezy/tests/test_diff.py (+9/-0)
doc/en/release-notes/brz-3.0.txt (+3/-0)
Changed in brz: | |
status: | New → Triaged |
importance: | Undecided → Medium |
Changed in brz: | |
status: | Triaged → In Progress |
assignee: | nobody → Jelmer Vernooij (jelmer) |
milestone: | none → 3.0.2 |
Changed in brz: | |
status: | In Progress → Fix Committed |
tags: | added: diff |
Changed in brz: | |
milestone: | 3.0.2 → 3.1.0 |
Changed in brz: | |
status: | Fix Committed → Fix Released |