From 085f52590723337921e7e8f89847cc9bd90224e3 Mon Sep 17 00:00:00 2001 From: memsharded Date: Tue, 30 Mar 2021 01:08:44 +0200 Subject: [PATCH 1/2] display user/channel correctly in export output --- conans/client/cmd/export.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/conans/client/cmd/export.py b/conans/client/cmd/export.py index 324d561d76b..03c6cd7f6e8 100644 --- a/conans/client/cmd/export.py +++ b/conans/client/cmd/export.py @@ -85,6 +85,8 @@ def cmd_export(app, conanfile_path, name, version, user, channel, keep_source, channel = None ref = ConanFileReference(conanfile.name, conanfile.version, user, channel) + conanfile.display_name = str(ref) + conanfile.output.scope = conanfile.display_name # If we receive lock information, python_requires could have been locked if graph_lock: From cf16ea0a8f5500699a09e516a10e9f29b9c88e63 Mon Sep 17 00:00:00 2001 From: memsharded Date: Tue, 30 Mar 2021 01:34:22 +0200 Subject: [PATCH 2/2] add test --- .../integration/command/export/test_export.py | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 conans/test/integration/command/export/test_export.py diff --git a/conans/test/integration/command/export/test_export.py b/conans/test/integration/command/export/test_export.py new file mode 100644 index 00000000000..6974dd00363 --- /dev/null +++ b/conans/test/integration/command/export/test_export.py @@ -0,0 +1,23 @@ +import textwrap + +from conans.test.utils.tools import TestClient + + +def test_basic(): + client = TestClient() + conanfile = textwrap.dedent(""" + from conans import ConanFile + class TestConan(ConanFile): + name = "hello" + version = "1.2" + default_user = "myuser" + default_channel = "mychannel" + """) + client.save({"conanfile.py": conanfile}) + client.run("export .") + assert "hello/1.2@myuser/mychannel" in client.out + client.run("search *") + assert "hello/1.2@myuser/mychannel" in client.out + client.run("create .") + assert "hello/1.2@myuser/mychannel" in client.out + assert "hello/1.2:" not in client.out