Skip to content

Commit

Permalink
display user/channel correctly in export output (#8732)
Browse files Browse the repository at this point in the history
* display user/channel correctly in export output

* add test
  • Loading branch information
memsharded committed Mar 30, 2021
1 parent 2f7de1b commit a78b3ab
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
2 changes: 2 additions & 0 deletions conans/client/cmd/export.py
Expand Up @@ -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:
Expand Down
23 changes: 23 additions & 0 deletions 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

0 comments on commit a78b3ab

Please sign in to comment.