Repository: conan-io/conan

Issue:
conan install fails to distinguish a path from a reference in some circumstances 
Hello!

I just noticed that conan 1.9.1 (at least) is not checking the nature of the `path_or_reference` argument to the `install` command properly. Specifically, if you pass it a `conanfile.txt` (or `conanfile.py`) with a relative path made of 3 or 4 elements it will consider it as reference instead of a path.

Here is a straight forward way to reproduce the problem:
```#!bash
$ mkdir -p foo/bar/baz
$ echo '[requires]' > foo/bar/baz/conanfile.txt
$ conan install foo/bar/baz/conanfile.txt
Configuration:
[settings]
os=Linux
os_build=Linux
arch=x86_64
arch_build=x86_64
compiler=gcc
compiler.version=5
compiler.libcxx=libstdc++
build_type=Release
[options]
[build_requires]
[env]

foo/bar@baz/conanfile.txt: Not found in local cache, looking in remotes...
foo/bar@baz/conanfile.txt: Trying with 'conan-pix4d'...
ERROR: Failed requirement 'foo/bar@baz/conanfile.txt' from 'PROJECT'
ERROR: Unable to find 'foo/bar@baz/conanfile.txt' in remotes
```

Using a shorter (or two element longer) path works:
```#!bash
$ cd foo
$ conan install bar/baz/conanfile.txt 
Configuration:
[settings]
os=Linux
os_build=Linux
arch=x86_64
arch_build=x86_64
compiler=gcc
compiler.version=5
compiler.libcxx=libstdc++
build_type=Release
[options]
[build_requires]
[env]

PROJECT: Installing /tmp/foo/bar/baz/conanfile.txt
Requirements
Packages

PROJECT: Generator txt created conanbuildinfo.txt
PROJECT: Generated conaninfo.txt
```

You can work around the problem easily by prefixing the path with `./` as it will then produce an invalid name for the reference and then conan will fall back to the path scenario.

A possible fix would be:
```
--- conans/client/command.py.bak       2018-11-16 17:18:46.984235498 +0100
+++ conans/client/command.py   2018-11-16 17:23:21.910007591 +0100
@@ -370,6 +370,8 @@
         info = None
         try:
             try:
+                if os.path.isfile(args.path_or_reference):
+                    raise ConanException()
                 reference = ConanFileReference.loads(args.path_or_reference)
             except ConanException:
                 info = self._conan.install(path=args.path_or_reference,
```


Discussion:
Thanks for reporting. The possible solution looks good! (maybe not raising the exception but definitely we should check if it is a real path)

Resolving patch:
diff --git a/conans/model/ref.py b/conans/model/ref.py
--- a/conans/model/ref.py
+++ b/conans/model/ref.py
@@ -79,7 +79,7 @@ class ConanFileReference(namedtuple("ConanFileReference", "name version user cha
     opencv/2.4.10@lasote/testing
     """
     whitespace_pattern = re.compile(r"\s+")
-    sep_pattern = re.compile("@|/|#")
+    sep_pattern = re.compile(r"([^/]+)/([^/]+)@([^/]+)/([^/#]+)#?(.+)?")
 
     def __new__(cls, name, version, user, channel, revision=None, validate=True):
         """Simple name creation.
@@ -111,12 +111,9 @@ def loads(text, validate=True):
         """ Parses a text string to generate a ConanFileReference object
         """
         text = ConanFileReference.whitespace_pattern.sub("", text)
-        tokens = ConanFileReference.sep_pattern.split(text)
         try:
-            if len(tokens) not in (4, 5):
-                raise ValueError
-            name, version, user, channel = tokens[0:4]
-            revision = tokens[4] if len(tokens) == 5 else None
+            # Split returns empty start and end groups
+            _, name, version, user, channel, revision, _ = ConanFileReference.sep_pattern.split(text)
         except ValueError:
             raise ConanException("Wrong package recipe reference %s\nWrite something like "
                                  "OpenCV/1.0.6@user/stable" % text)


Test patch:
diff --git a/conans/test/command/info_options_test.py b/conans/test/command/info_options_test.py
--- a/conans/test/command/info_options_test.py
+++ b/conans/test/command/info_options_test.py
@@ -38,6 +38,6 @@ class Pkg(ConanFile):
         client.run("create . PkgA/0.1@user/testing")
         client.save({"conanfile.py": conanfile.format("B")})
         client.run("install .")
-        client.run("info PkgA@0.1@user/testing")
+        client.run("info PkgA/0.1@user/testing")
         self.assertIn("PkgA/0.1@user/testing", client.out)
         self.assertIn("BuildID: None", client.out)
diff --git a/conans/test/command/install_test.py b/conans/test/command/install_test.py
--- a/conans/test/command/install_test.py
+++ b/conans/test/command/install_test.py
@@ -1,14 +1,14 @@
-import unittest
-import platform
 import os
+import platform
+import unittest
 
-from conans.test.utils.tools import TestClient, TestServer
+from conans.client.conf.detect import detected_os
+from conans.model.info import ConanInfo
 from conans.model.ref import ConanFileReference, PackageReference
 from conans.paths import CONANFILE, CONANINFO
-from conans.model.info import ConanInfo
-from conans.test.utils.cpp_test_files import cpp_hello_conan_files
 from conans.paths import CONANFILE_TXT
-from conans.client.conf.detect import detected_os
+from conans.test.utils.cpp_test_files import cpp_hello_conan_files
+from conans.test.utils.tools import TestClient, TestServer
 from conans.util.files import load, mkdir, rmdir
 
 
@@ -19,6 +19,13 @@ def setUp(self):
         self.settings = ("-s os=Windows -s compiler='Visual Studio' -s compiler.version=12 "
                          "-s arch=x86 -s compiler.runtime=MD")
 
+    def test_four_subfolder_install(self):
+        # https://github.com/conan-io/conan/issues/3950
+        conanfile = ""
+        self.client.save({"path/to/sub/folder/conanfile.txt": conanfile})
+        # If this doesn't, fail, all good
+        self.client.run("install path/to/sub/folder")
+
     def install_system_requirements_test(self):
         client = TestClient(servers={"default": TestServer()},
                             users={"default": [("lasote", "mypass")]})
diff --git a/conans/test/command/remove_test.py b/conans/test/command/remove_test.py
--- a/conans/test/command/remove_test.py
+++ b/conans/test/command/remove_test.py
@@ -96,6 +96,7 @@ class Test(ConanFile):
             self.assertNotIn("os: Windows", client.user_io.out)
             self.assertIn("os: Linux", client.user_io.out)
 
+
 fake_recipe_hash = "999999999"
 conaninfo = '''
 [settings]
@@ -108,7 +109,7 @@ class Test(ConanFile):
 [full_requires]
   Hello2/0.1@lasote/stable:11111
   OpenSSL/2.10@lasote/testing:2222
-  HelloInfo1/0.45@fenix/testing:33333
+  HelloInfo1/0.45@myuser/testing:33333
 [recipe_hash]
 ''' + fake_recipe_hash +  '''
 [recipe_revision]
@@ -122,22 +123,23 @@ def setUp(self):
         test_conanfile_contents = hello_files[CONANFILE]
 
         self.server_folder = temp_folder()
-        test_server = TestServer(users={"fenix": "mypass"},
+        test_server = TestServer(users={"myuser": "mypass"},
                                  base_path=self.server_folder)  # exported users and passwords
         self.server = test_server
         servers = {"default": test_server}
-        client = TestClient(servers=servers, users={"default": [("fenix", "mypass")]})
+        client = TestClient(servers=servers, users={"default": [("myuser", "mypass")]})
 
         # Conans with and without packages created
-        self.root_folder = {"H1": 'Hello/1.4.10/fenix/testing',
-                            "H2": 'Hello/2.4.11/fenix/testing',
-                            "B": 'Bye/0.14/fenix/testing',
-                            "O": 'Other/1.2/fenix/testing'}
+        self.root_folder = {"H1": 'Hello/1.4.10@myuser/testing',
+                            "H2": 'Hello/2.4.11@myuser/testing',
+                            "B": 'Bye/0.14@myuser/testing',
+                            "O": 'Other/1.2@myuser/testing'}
 
         files = {}
         pack_refs = []
         for key, folder in self.root_folder.items():
             ref = ConanFileReference.loads(folder)
+            folder = folder.replace("@", "/")
             files["%s/%s/conanfile.py" % (folder, EXPORT_FOLDER)] = test_conanfile_contents
             files["%s/%s/conanmanifest.txt" % (folder, EXPORT_FOLDER)] = "%s\nconanfile.py: 234234234" % fake_recipe_hash
             files["%s/%s/conans.txt" % (folder, SRC_FOLDER)] = ""
@@ -169,7 +171,7 @@ def setUp(self):
         self.client = client
 
         for folder in self.root_folder.values():
-            client.run("upload %s --all" % folder.replace("/fenix", "@fenix"))
+            client.run("upload %s --all" % folder)
 
         self.assert_folders({"H1": [1, 2], "H2": [1, 2], "B": [1, 2], "O": [1, 2]},
                             {"H1": [1, 2], "H2": [1, 2], "B": [1, 2], "O": [1, 2]},
@@ -181,8 +183,8 @@ def assert_folders(self, local_folders, remote_folders, build_folders, src_folde
                                    (self.server.paths, remote_folders)]:
             root_folder = base_path.store
             for k, shas in folders.items():
-                folder = os.path.join(root_folder, self.root_folder[k])
-                ref = ConanFileReference(*self.root_folder[k].split("/"))
+                folder = os.path.join(root_folder, self.root_folder[k].replace("@", "/"))
+                ref = ConanFileReference.loads(self.root_folder[k])
                 if isinstance(base_path, ServerStore):
                     if not self.client.block_v2:
                         try:
@@ -213,13 +215,14 @@ def assert_folders(self, local_folders, remote_folders, build_folders, src_folde
                                 prev = DEFAULT_REVISION_V1
                             package_folder += "/%s" % prev
                         if value in shas:
-                            self.assertTrue(os.path.exists(package_folder), "%s doesn't exist " % package_folder)
+                            self.assertTrue(os.path.exists(package_folder),
+                                            "%s doesn't exist " % package_folder)
                         else:
                             self.assertFalse(os.path.exists(package_folder))
 
         root_folder = self.client.paths.store
         for k, shas in build_folders.items():
-            folder = os.path.join(root_folder, self.root_folder[k])
+            folder = os.path.join(root_folder, self.root_folder[k].replace("@", "/"))
             if shas is None:
                 self.assertFalse(os.path.exists(folder))
             else:
@@ -231,7 +234,7 @@ def assert_folders(self, local_folders, remote_folders, build_folders, src_folde
                     else:
                         self.assertFalse(os.path.exists(build_folder))
         for k, value in src_folders.items():
-            folder = os.path.join(root_folder, self.root_folder[k], "source")
+            folder = os.path.join(root_folder, self.root_folder[k].replace("@", "/"), "source")
             if value:
                 self.assertTrue(os.path.exists(folder))
             else:
@@ -267,10 +270,10 @@ def basic_packages_test(self):
         six.assertCountEqual(self, ["Hello", "Other", "Bye"], folders)
         six.assertCountEqual(self, ["build", "source", "export", "export_source", "metadata.json"],
                              os.listdir(os.path.join(self.client.storage_folder,
-                                                     "Hello/1.4.10/fenix/testing")))
+                                                     "Hello/1.4.10/myuser/testing")))
         six.assertCountEqual(self, ["build", "source", "export", "export_source", "metadata.json"],
                              os.listdir(os.path.join(self.client.storage_folder,
-                                                     "Hello/2.4.11/fenix/testing")))
+                                                     "Hello/2.4.11/myuser/testing")))
 
     def builds_test(self):
         mocked_user_io = UserIO(out=TestBufferConanOutput())
@@ -285,11 +288,11 @@ def builds_test(self):
         six.assertCountEqual(self, ["package", "source", "export", "export_source",
                                     "metadata.json"],
                              os.listdir(os.path.join(self.client.storage_folder,
-                                                     "Hello/1.4.10/fenix/testing")))
+                                                     "Hello/1.4.10/myuser/testing")))
         six.assertCountEqual(self, ["package", "source", "export", "export_source",
                                     "metadata.json"],
                              os.listdir(os.path.join(self.client.storage_folder,
-                                                     "Hello/2.4.11/fenix/testing")))
+                                                     "Hello/2.4.11/myuser/testing")))
 
     def src_test(self):
         mocked_user_io = UserIO(out=TestBufferConanOutput())
@@ -303,10 +306,10 @@ def src_test(self):
         six.assertCountEqual(self, ["Hello", "Other", "Bye"], folders)
         six.assertCountEqual(self, ["package", "build", "export", "export_source", "metadata.json"],
                              os.listdir(os.path.join(self.client.storage_folder,
-                                                     "Hello/1.4.10/fenix/testing")))
+                                                     "Hello/1.4.10/myuser/testing")))
         six.assertCountEqual(self, ["package", "build", "export", "export_source", "metadata.json"],
                              os.listdir(os.path.join(self.client.storage_folder,
-                                                     "Hello/2.4.11/fenix/testing")))
+                                                     "Hello/2.4.11/myuser/testing")))
 
     def reject_removal_test(self):
         mocked_user_io = UserIO(out=TestBufferConanOutput())
@@ -387,35 +390,35 @@ def remove_remote_specific_packages_test(self):
     def try_remove_using_query_and_packages_or_builds_test(self):
         with self.assertRaisesRegexp(Exception, "Command failed"):
             self.client.run("remove hello/1.4.10@lasote/stable -p=1_H1 -q 'compiler.version=4.8' ")
-            self.assertIn("'-q' and '-p' parameters can't be used at the same time", self.client.user_io.out)
+            self.assertIn("'-q' and '-p' parameters can't be used at the same time", self.client.out)
 
         with self.assertRaisesRegexp(Exception, "Command failed"):
             self.client.run("remove hello/1.4.10@lasote/stable -b=1_H1 -q 'compiler.version=4.8' ")
-            self.assertIn("'-q' and '-b' parameters can't be used at the same time", self.client.user_io.out)
+            self.assertIn("'-q' and '-b' parameters can't be used at the same time", self.client.out)
 
     def query_remove_locally_test(self):
-        self.client.run("remove hello/1.4.10@fenix/testing -q='compiler.version=4.4' -f")
+        self.client.run("remove hello/1.4.10@myuser/testing -q='compiler.version=4.4' -f")
         self.assertIn("No matching packages to remove", self.client.user_io.out)
         self.assert_folders({"H1": [1, 2], "H2": [1, 2], "B": [1, 2], "O": [1, 2]},
                             {"H1": [1, 2], "H2": [1, 2], "B": [1, 2], "O": [1, 2]},
                             {"H1": [1, 2], "H2": [1, 2], "B": [1, 2], "O": [1, 2]},
                             {"H1": True, "H2": True, "B": True, "O": True})
 
-        self.client.run('remove Hello/1.4.10@fenix/testing -q="compiler.version=8.1" -f')
+        self.client.run('remove Hello/1.4.10@myuser/testing -q="compiler.version=8.1" -f')
         self.assertNotIn("No packages matching the query", self.client.user_io.out)
         self.assert_folders(local_folders={"H1": [2], "H2": [1, 2], "B": [1, 2], "O": [1, 2]},
                             remote_folders={"H1": [1, 2], "H2": [1, 2], "B": [1, 2], "O": [1, 2]},
                             build_folders={"H1": [1, 2], "H2": [1, 2], "B": [1, 2], "O": [1, 2]},
                             src_folders={"H1": True, "H2": True, "B": True, "O": True})
 
-        self.client.run('remove Hello/1.4.10@fenix/testing -q="compiler.version=8.2" -f')
+        self.client.run('remove Hello/1.4.10@myuser/testing -q="compiler.version=8.2" -f')
         self.assertNotIn("No packages matching the query", self.client.user_io.out)
         self.assert_folders(local_folders={"H1": [], "H2": [1, 2], "B": [1, 2], "O": [1, 2]},
                             remote_folders={"H1": [1, 2], "H2": [1, 2], "B": [1, 2], "O": [1, 2]},
                             build_folders={"H1": [1, 2], "H2": [1, 2], "B": [1, 2], "O": [1, 2]},
                             src_folders={"H1": True, "H2": True, "B": True, "O": True})
 
-        self.client.run('remove Hello/1.4.10@fenix/testing -q="compiler.version=8.2" -f -r default')
+        self.client.run('remove Hello/1.4.10@myuser/testing -q="compiler.version=8.2" -f -r default')
         self.assertNotIn("No packages matching the query", self.client.user_io.out)
         self.assert_folders(local_folders={"H1": [], "H2": [1, 2], "B": [1, 2], "O": [1, 2]},
                             remote_folders={"H1": [1], "H2": [1, 2], "B": [1, 2], "O": [1, 2]},
diff --git a/conans/test/command/search_test.py b/conans/test/command/search_test.py
--- a/conans/test/command/search_test.py
+++ b/conans/test/command/search_test.py
@@ -1,15 +1,14 @@
 import json
 import os
+import shutil
 import unittest
 from collections import OrderedDict
 
-import shutil
-
 from conans import COMPLEX_SEARCH_CAPABILITY
+from conans import DEFAULT_REVISION_V1
 from conans.model.manifest import FileTreeManifest
 from conans.model.ref import ConanFileReference, PackageReference
 from conans.paths import PACKAGES_FOLDER, CONANINFO, EXPORT_FOLDER
-from conans import DEFAULT_REVISION_V1
 from conans.test.utils.tools import TestClient, TestServer
 from conans.util.files import load, list_folder_subdirs
 
@@ -24,7 +23,7 @@
 [full_requires]
   Hello2/0.1@lasote/stable:11111
   OpenSSL/2.10@lasote/testing:2222
-  HelloInfo1/0.45@fenix/testing:33333
+  HelloInfo1/0.45@myuser/testing:33333
 '''
 
 conan_vars1b = '''
@@ -49,7 +48,7 @@
 [full_requires]
   Hello2/0.1@lasote/stable:11111
   OpenSSL/2.10@lasote/testing:2222
-  HelloInfo1/0.45@fenix/testing:33333
+  HelloInfo1/0.45@myuser/testing:33333
 [recipe_hash]
   d41d8cd98f00b204e9800998ecf8427e
 '''  # The recipe_hash correspond to the faked conanmanifests in export
@@ -80,7 +79,7 @@
 [full_requires]
   Hello2/0.1@lasote/stable:11111
   OpenSSL/2.10@lasote/testing:2222
-  HelloInfo1/0.45@fenix/testing:33333
+  HelloInfo1/0.45@myuser/testing:33333
 """
 
 
@@ -99,13 +98,13 @@ def setUp(self):
         self.assertIn('There are no packages', output)
 
         # Conans with and without packages created
-        root_folder1 = 'Hello/1.4.10/fenix/testing'
-        root_folder2 = 'helloTest/1.4.10/fenix/stable'
-        root_folder3 = 'Bye/0.14/fenix/testing'
-        root_folder4 = 'NodeInfo/1.0.2/fenix/stable'
-        root_folder5 = 'MissFile/1.0.2/fenix/stable'
-        root_folder11 = 'Hello/1.4.11/fenix/testing'
-        root_folder12 = 'Hello/1.4.12/fenix/testing'
+        root_folder1 = 'Hello/1.4.10/myuser/testing'
+        root_folder2 = 'helloTest/1.4.10/myuser/stable'
+        root_folder3 = 'Bye/0.14/myuser/testing'
+        root_folder4 = 'NodeInfo/1.0.2/myuser/stable'
+        root_folder5 = 'MissFile/1.0.2/myuser/stable'
+        root_folder11 = 'Hello/1.4.11/myuser/testing'
+        root_folder12 = 'Hello/1.4.12/myuser/testing'
 
         self.client.save({"Empty/1.10/fake/test/export/fake.txt": "//",
                           "%s/%s/WindowsPackageSHA/%s" % (root_folder1,
@@ -156,10 +155,10 @@ def recipe_search_all_test(self):
         def check():
             for remote in ("local", "search_able"):
                 expected = """Remote '{}':
-Hello/1.4.10@fenix/testing
-Hello/1.4.11@fenix/testing
-Hello/1.4.12@fenix/testing
-helloTest/1.4.10@fenix/stable""".format(remote)
+Hello/1.4.10@myuser/testing
+Hello/1.4.11@myuser/testing
+Hello/1.4.12@myuser/testing
+helloTest/1.4.10@myuser/stable""".format(remote)
                 self.assertIn(expected, self.client.out)
 
         self.client.run("search Hello* -r=all")
@@ -171,98 +170,100 @@ def check():
     def recipe_search_test(self):
         self.client.run("search Hello*")
         self.assertEquals("Existing package recipes:\n\n"
-                          "Hello/1.4.10@fenix/testing\n"
-                          "Hello/1.4.11@fenix/testing\n"
-                          "Hello/1.4.12@fenix/testing\n"
-                          "helloTest/1.4.10@fenix/stable\n", self.client.out)
+                          "Hello/1.4.10@myuser/testing\n"
+                          "Hello/1.4.11@myuser/testing\n"
+                          "Hello/1.4.12@myuser/testing\n"
+                          "helloTest/1.4.10@myuser/stable\n", self.client.out)
 
         self.client.run("search Hello* --case-sensitive")
         self.assertEquals("Existing package recipes:\n\n"
-                          "Hello/1.4.10@fenix/testing\n"
-                          "Hello/1.4.11@fenix/testing\n"
-                          "Hello/1.4.12@fenix/testing\n",
+                          "Hello/1.4.10@myuser/testing\n"
+                          "Hello/1.4.11@myuser/testing\n"
+                          "Hello/1.4.12@myuser/testing\n",
                           self.client.out)
 
-        self.client.run("search *fenix* --case-sensitive")
+        self.client.run("search *myuser* --case-sensitive")
         self.assertEquals("Existing package recipes:\n\n"
-                          "Bye/0.14@fenix/testing\n"
-                          "Hello/1.4.10@fenix/testing\n"
-                          "Hello/1.4.11@fenix/testing\n"
-                          "Hello/1.4.12@fenix/testing\n"
-                          "MissFile/1.0.2@fenix/stable\n"
-                          "NodeInfo/1.0.2@fenix/stable\n"
-                          "helloTest/1.4.10@fenix/stable\n", self.client.out)
-
-        self.client.run("search Hello/*@fenix/testing")
-        self.assertIn("Hello/1.4.10@fenix/testing\n"
-                      "Hello/1.4.11@fenix/testing\n"
-                      "Hello/1.4.12@fenix/testing\n", self.client.out)
+                          "Bye/0.14@myuser/testing\n"
+                          "Hello/1.4.10@myuser/testing\n"
+                          "Hello/1.4.11@myuser/testing\n"
+                          "Hello/1.4.12@myuser/testing\n"
+                          "MissFile/1.0.2@myuser/stable\n"
+                          "NodeInfo/1.0.2@myuser/stable\n"
+                          "helloTest/1.4.10@myuser/stable\n", self.client.out)
+
+        self.client.run("search Hello/*@myuser/testing")
+        self.assertIn("Hello/1.4.10@myuser/testing\n"
+                      "Hello/1.4.11@myuser/testing\n"
+                      "Hello/1.4.12@myuser/testing\n", self.client.out)
 
     def search_partial_match_test(self):
         self.client.run("search Hello")
         self.assertEquals("Existing package recipes:\n\n"
-                          "Hello/1.4.10@fenix/testing\n"
-                          "Hello/1.4.11@fenix/testing\n"
-                          "Hello/1.4.12@fenix/testing\n", self.client.out)
+                          "Hello/1.4.10@myuser/testing\n"
+                          "Hello/1.4.11@myuser/testing\n"
+                          "Hello/1.4.12@myuser/testing\n", self.client.out)
 
         self.client.run("search hello")
         self.assertEquals("Existing package recipes:\n\n"
-                          "Hello/1.4.10@fenix/testing\n"
-                          "Hello/1.4.11@fenix/testing\n"
-                          "Hello/1.4.12@fenix/testing\n", self.client.out)
+                          "Hello/1.4.10@myuser/testing\n"
+                          "Hello/1.4.11@myuser/testing\n"
+                          "Hello/1.4.12@myuser/testing\n", self.client.out)
 
         self.client.run("search Hello --case-sensitive")
         self.assertEquals("Existing package recipes:\n\n"
-                          "Hello/1.4.10@fenix/testing\n"
-                          "Hello/1.4.11@fenix/testing\n"
-                          "Hello/1.4.12@fenix/testing\n", self.client.out)
+                          "Hello/1.4.10@myuser/testing\n"
+                          "Hello/1.4.11@myuser/testing\n"
+                          "Hello/1.4.12@myuser/testing\n", self.client.out)
 
         self.client.run("search Hel")
         self.assertEquals("There are no packages matching the 'Hel' pattern\n", self.client.out)
 
         self.client.run("search Hello/")
         self.assertEquals("Existing package recipes:\n\n"
-                          "Hello/1.4.10@fenix/testing\n"
-                          "Hello/1.4.11@fenix/testing\n"
-                          "Hello/1.4.12@fenix/testing\n", self.client.out)
+                          "Hello/1.4.10@myuser/testing\n"
+                          "Hello/1.4.11@myuser/testing\n"
+                          "Hello/1.4.12@myuser/testing\n", self.client.out)
 
         self.client.run("search Hello/1.4.10")
         self.assertEquals("Existing package recipes:\n\n"
-                          "Hello/1.4.10@fenix/testing\n", self.client.out)
+                          "Hello/1.4.10@myuser/testing\n", self.client.out)
 
         self.client.run("search Hello/1.4")
-        self.assertEquals("There are no packages matching the 'Hello/1.4' pattern\n", self.client.out)
+        self.assertEquals("There are no packages matching the 'Hello/1.4' pattern\n",
+                          self.client.out)
 
         self.client.run("search Hello/1.4.10@")
         self.assertEquals("Existing package recipes:\n\n"
-                          "Hello/1.4.10@fenix/testing\n", self.client.out)
+                          "Hello/1.4.10@myuser/testing\n", self.client.out)
 
-        self.client.run("search Hello/1.4.10@fenix")
+        self.client.run("search Hello/1.4.10@myuser")
         self.assertEquals("Existing package recipes:\n\n"
-                          "Hello/1.4.10@fenix/testing\n", self.client.out)
+                          "Hello/1.4.10@myuser/testing\n", self.client.out)
 
         self.client.run("search Hello/1.4.10@fen")
-        self.assertEquals("There are no packages matching the 'Hello/1.4.10@fen' pattern\n", self.client.out)
+        self.assertEquals("There are no packages matching the 'Hello/1.4.10@fen' pattern\n",
+                          self.client.out)
 
-        self.client.run("search Hello/1.4.10@fenix/")
+        self.client.run("search Hello/1.4.10@myuser/")
         self.assertEquals("Existing package recipes:\n\n"
-                          "Hello/1.4.10@fenix/testing\n", self.client.out)
+                          "Hello/1.4.10@myuser/testing\n", self.client.out)
 
-        error = self.client.run("search Hello/1.4.10@fenix/test", ignore_error=True)
+        error = self.client.run("search Hello/1.4.10@myuser/test", ignore_error=True)
         self.assertTrue(error)
-        self.assertEquals("ERROR: Recipe not found: Hello/1.4.10@fenix/test\n", self.client.out)
+        self.assertEquals("ERROR: Recipe not found: Hello/1.4.10@myuser/test\n", self.client.out)
 
     def search_raw_test(self):
         self.client.run("search Hello* --raw")
-        self.assertEquals("Hello/1.4.10@fenix/testing\n"
-                          "Hello/1.4.11@fenix/testing\n"
-                          "Hello/1.4.12@fenix/testing\n"
-                          "helloTest/1.4.10@fenix/stable\n", self.client.out)
+        self.assertEquals("Hello/1.4.10@myuser/testing\n"
+                          "Hello/1.4.11@myuser/testing\n"
+                          "Hello/1.4.12@myuser/testing\n"
+                          "helloTest/1.4.10@myuser/stable\n", self.client.out)
 
     def search_html_table_test(self):
-        self.client.run("search Hello/1.4.10/fenix/testing --table=table.html")
+        self.client.run("search Hello/1.4.10@myuser/testing --table=table.html")
         html = load(os.path.join(self.client.current_folder, "table.html"))
-        self.assertIn("<h1>Hello/1.4.10@fenix/testing</h1>", html)
+        self.assertIn("<h1>Hello/1.4.10@myuser/testing</h1>", html)
         self.assertIn("<td>Linux gcc 4.5 (libstdc++11)</td>", html)
         self.assertIn("<td>Windows Visual Studio 8.1</td>", html)
 
@@ -272,10 +273,10 @@ def search_html_table_all_test(self):
         os.rmdir(self.servers["search_able"].paths.store)
         self._copy_to_server(self.client.paths, self.servers["search_able"].paths)
 
-        self.client.run("search Hello/1.4.10/fenix/testing -r=all --table=table.html")
+        self.client.run("search Hello/1.4.10@myuser/testing -r=all --table=table.html")
         html = load(os.path.join(self.client.current_folder, "table.html"))
 
-        self.assertIn("<h1>Hello/1.4.10@fenix/testing</h1>", html)
+        self.assertIn("<h1>Hello/1.4.10@myuser/testing</h1>", html)
         self.assertIn("<h2>'local':</h2>", html)
         self.assertIn("<h2>'search_able':</h2>", html)
 
@@ -290,44 +291,46 @@ def search_html_table_with_no_reference_test(self):
     def recipe_pattern_search_test(self):
         self.client.run("search Hello*")
         self.assertEquals("Existing package recipes:\n\n"
-                          "Hello/1.4.10@fenix/testing\n"
-                          "Hello/1.4.11@fenix/testing\n"
-                          "Hello/1.4.12@fenix/testing\n"
-                          "helloTest/1.4.10@fenix/stable\n", self.client.out)
+                          "Hello/1.4.10@myuser/testing\n"
+                          "Hello/1.4.11@myuser/testing\n"
+                          "Hello/1.4.12@myuser/testing\n"
+                          "helloTest/1.4.10@myuser/stable\n", self.client.out)
 
         self.client.run("search Hello* --case-sensitive")
         self.assertEquals("Existing package recipes:\n\n"
-                          "Hello/1.4.10@fenix/testing\n"
-                          "Hello/1.4.11@fenix/testing\n"
-                          "Hello/1.4.12@fenix/testing\n", self.client.out)
+                          "Hello/1.4.10@myuser/testing\n"
+                          "Hello/1.4.11@myuser/testing\n"
+                          "Hello/1.4.12@myuser/testing\n", self.client.out)
 
-        self.client.run("search *fenix* --case-sensitive")
+        self.client.run("search *myuser* --case-sensitive")
         self.assertEquals("Existing package recipes:\n\n"
-                          "Bye/0.14@fenix/testing\n"
-                          "Hello/1.4.10@fenix/testing\n"
-                          "Hello/1.4.11@fenix/testing\n"
-                          "Hello/1.4.12@fenix/testing\n"
-                          "MissFile/1.0.2@fenix/stable\n"
-                          "NodeInfo/1.0.2@fenix/stable\n"
-                          "helloTest/1.4.10@fenix/stable\n", self.client.out)
+                          "Bye/0.14@myuser/testing\n"
+                          "Hello/1.4.10@myuser/testing\n"
+                          "Hello/1.4.11@myuser/testing\n"
+                          "Hello/1.4.12@myuser/testing\n"
+                          "MissFile/1.0.2@myuser/stable\n"
+                          "NodeInfo/1.0.2@myuser/stable\n"
+                          "helloTest/1.4.10@myuser/stable\n", self.client.out)
 
     def package_search_with_invalid_reference_test(self):
         self.client.run("search Hello -q 'a=1'", ignore_error=True)
         self.assertIn("-q parameter only allowed with a valid recipe", str(self.client.out))
 
     def package_search_with_empty_query_test(self):
-        self.client.run("search Hello/1.4.10/fenix/testing")
+        self.client.run("search Hello/1.4.10@myuser/testing")
         self.assertIn("WindowsPackageSHA", self.client.out)
         self.assertIn("PlatformIndependantSHA", self.client.out)
         self.assertIn("LinuxPackageSHA", self.client.out)
 
     def package_search_nonescaped_characters_test(self):
-        self.client.run('search Hello/1.4.10@fenix/testing -q "compiler=gcc AND compiler.libcxx=libstdc++11"')
+        self.client.run('search Hello/1.4.10@myuser/testing '
+                        '-q "compiler=gcc AND compiler.libcxx=libstdc++11"')
         self.assertIn("LinuxPackageSHA", self.client.out)
         self.assertNotIn("PlatformIndependantSHA", self.client.out)
         self.assertNotIn("WindowsPackageSHA", self.client.out)
 
-        self.client.run('search Hello/1.4.10@fenix/testing -q "compiler=gcc AND compiler.libcxx=libstdc++"')
+        self.client.run('search Hello/1.4.10@myuser/testing '
+                        '-q "compiler=gcc AND compiler.libcxx=libstdc++"')
         self.assertNotIn("LinuxPackageSHA", self.client.out)
         self.assertIn("PlatformIndependantSHA", self.client.out)
         self.assertNotIn("WindowsPackageSHA", self.client.out)
@@ -336,13 +339,15 @@ def package_search_nonescaped_characters_test(self):
         os.rmdir(self.servers["local"].paths.store)
         self._copy_to_server(self.client.paths, self.servers["local"].paths)
 
-        self.client.run('search Hello/1.4.10@fenix/testing -q "compiler=gcc AND compiler.libcxx=libstdc++11" -r local')
+        self.client.run('search Hello/1.4.10@myuser/testing '
+                        '-q "compiler=gcc AND compiler.libcxx=libstdc++11" -r local')
         self.assertIn("Outdated from recipe: False", self.client.out)
         self.assertIn("LinuxPackageSHA", self.client.out)
         self.assertNotIn("PlatformIndependantSHA", self.client.out)
         self.assertNotIn("WindowsPackageSHA", self.client.out)
 
-        self.client.run('search Hello/1.4.10@fenix/testing -q "compiler=gcc AND compiler.libcxx=libstdc++" -r local')
+        self.client.run('search Hello/1.4.10@myuser/testing '
+                        '-q "compiler=gcc AND compiler.libcxx=libstdc++" -r local')
         self.assertNotIn("LinuxPackageSHA", self.client.out)
         self.assertIn("PlatformIndependantSHA", self.client.out)
         self.assertNotIn("WindowsPackageSHA", self.client.out)
@@ -351,20 +356,22 @@ def package_search_nonescaped_characters_test(self):
         os.rmdir(self.servers["search_able"].paths.store)
         self._copy_to_server(self.client.paths, self.servers["search_able"].paths)
 
-        self.client.run('search Hello/1.4.10@fenix/testing -q "compiler=gcc AND compiler.libcxx=libstdc++11" -r all')
+        self.client.run('search Hello/1.4.10@myuser/testing '
+                        '-q "compiler=gcc AND compiler.libcxx=libstdc++11" -r all')
         self.assertEqual(str(self.client.out).count("Outdated from recipe: False"), 2)
         self.assertEqual(str(self.client.out).count("LinuxPackageSHA"), 2)
         self.assertNotIn("PlatformIndependantSHA", self.client.out)
         self.assertNotIn("WindowsPackageSHA", self.client.out)
 
-        self.client.run('search Hello/1.4.10@fenix/testing -q "compiler=gcc AND compiler.libcxx=libstdc++" -r all')
+        self.client.run('search Hello/1.4.10@myuser/testing '
+                        '-q "compiler=gcc AND compiler.libcxx=libstdc++" -r all')
         self.assertNotIn("LinuxPackageSHA", self.client.out)
         self.assertEqual(str(self.client.out).count("PlatformIndependantSHA"), 2)
         self.assertNotIn("WindowsPackageSHA", self.client.out)
 
     def _assert_pkg_q(self, query, packages_found, remote):
 
-        command = 'search Hello/1.4.10@fenix/testing -q \'%s\'' % query
+        command = 'search Hello/1.4.10@myuser/testing -q \'%s\'' % query
         if remote:
             command += " -r %s" % remote
         self.client.run(command)
@@ -442,7 +449,8 @@ def test_cases(remote=None):
 
     def _copy_to_server(self, client_store_path, server_store):
         subdirs = list_folder_subdirs(basedir=client_store_path.store, level=4)
-        refs = [ConanFileReference(*folder.split("/"), revision=DEFAULT_REVISION_V1) for folder in subdirs]
+        refs = [ConanFileReference(*folder.split("/"), revision=DEFAULT_REVISION_V1)
+                for folder in subdirs]
         for ref in refs:
             origin_path = client_store_path.export(ref)
             dest_path = server_store.export(ref)
@@ -464,7 +472,7 @@ def package_search_all_remotes_test(self):
         os.rmdir(self.servers["search_able"].paths.store)
         self._copy_to_server(self.client.paths, self.servers["search_able"].paths)
 
-        self.client.run("search Hello/1.4.10/fenix/testing -r=all")
+        self.client.run("search Hello/1.4.10@myuser/testing -r=all")
         self.assertIn("Existing recipe in remote 'local':", self.client.out)
         self.assertIn("Existing recipe in remote 'search_able':", self.client.out)
 
@@ -473,70 +481,77 @@ def package_search_all_remotes_test(self):
         self.assertEqual(str(self.client.out).count("LinuxPackageSHA"), 2)
 
     def package_search_with_invalid_query_test(self):
-        self.client.run("search Hello/1.4.10/fenix/testing -q 'invalid'", ignore_error=True)
+        self.client.run("search Hello/1.4.10@myuser/testing -q 'invalid'", ignore_error=True)
         self.assertIn("Invalid package query: invalid", self.client.out)
 
-        self.client.run("search Hello/1.4.10/fenix/testing -q 'os= 3'", ignore_error=True)
+        self.client.run("search Hello/1.4.10@myuser/testing -q 'os= 3'", ignore_error=True)
         self.assertIn("Invalid package query: os= 3", self.client.out)
 
-        self.client.run("search Hello/1.4.10/fenix/testing -q 'os=3 FAKE '", ignore_error=True)
+        self.client.run("search Hello/1.4.10@myuser/testing -q 'os=3 FAKE '", ignore_error=True)
         self.assertIn("Invalid package query: os=3 FAKE ", self.client.out)
 
-        self.client.run("search Hello/1.4.10/fenix/testing -q 'os=3 os.compiler=4'", ignore_error=True)
+        self.client.run("search Hello/1.4.10@myuser/testing -q 'os=3 os.compiler=4'",
+                        ignore_error=True)
         self.assertIn("Invalid package query: os=3 os.compiler=4", self.client.out)
 
-        self.client.run("search Hello/1.4.10/fenix/testing -q 'not os=3 AND os.compiler=4'", ignore_error=True)
-        self.assertIn("Invalid package query: not os=3 AND os.compiler=4. 'not' operator is not allowed",
+        self.client.run("search Hello/1.4.10@myuser/testing -q 'not os=3 AND os.compiler=4'",
+                        ignore_error=True)
+        self.assertIn("Invalid package query: not os=3 AND os.compiler=4. "
+                      "'not' operator is not allowed",
                       self.client.out)
 
-        self.client.run("search Hello/1.4.10/fenix/testing -q 'os=3 AND !os.compiler=4'", ignore_error=True)
-        self.assertIn("Invalid package query: os=3 AND !os.compiler=4. '!' character is not allowed", self.client.out)
+        self.client.run("search Hello/1.4.10@myuser/testing -q 'os=3 AND !os.compiler=4'",
+                        ignore_error=True)
+        self.assertIn("Invalid package query: os=3 AND !os.compiler=4. '!' character is not allowed",
+                      self.client.out)
 
     def package_search_properties_filter_test(self):
 
         # All packages without filter
-        self.client.run("search Hello/1.4.10/fenix/testing -q ''")
+        self.client.run("search Hello/1.4.10@myuser/testing -q ''")
 
         self.assertIn("WindowsPackageSHA", self.client.out)
         self.assertIn("PlatformIndependantSHA", self.client.out)
         self.assertIn("LinuxPackageSHA", self.client.out)
 
-        self.client.run('search Hello/1.4.10/fenix/testing -q os=Windows')
+        self.client.run('search Hello/1.4.10@myuser/testing -q os=Windows')
         self.assertIn("WindowsPackageSHA", self.client.out)
         self.assertNotIn("PlatformIndependantSHA", self.client.out)
         self.assertNotIn("LinuxPackageSHA", self.client.out)
 
-        self.client.run('search Hello/1.4.10/fenix/testing -q "os=Windows or os=None"')
+        self.client.run('search Hello/1.4.10@myuser/testing -q "os=Windows or os=None"')
         self.assertIn("WindowsPackageSHA", self.client.out)
         self.assertIn("PlatformIndependantSHA", self.client.out)
         self.assertNotIn("LinuxPackageSHA", self.client.out)
 
-        self.client.run('search Hello/1.4.10/fenix/testing -q "os=Windows or os=Linux"')
+        self.client.run('search Hello/1.4.10@myuser/testing -q "os=Windows or os=Linux"')
         self.assertIn("WindowsPackageSHA", self.client.out)
         self.assertNotIn("PlatformIndependantSHA", self.client.out)
         self.assertIn("LinuxPackageSHA", self.client.out)
 
-        self.client.run('search Hello/1.4.10/fenix/testing -q "os=Windows AND compiler.version=4.5"')
-        self.assertIn("There are no packages for reference 'Hello/1.4.10@fenix/testing' "
+        self.client.run('search Hello/1.4.10@myuser/testing '
+                        '-q "os=Windows AND compiler.version=4.5"')
+        self.assertIn("There are no packages for reference 'Hello/1.4.10@myuser/testing' "
                       "matching the query 'os=Windows AND compiler.version=4.5'", self.client.out)
 
-        self.client.run('search Hello/1.4.10/fenix/testing -q "os=Linux AND compiler.version=4.5"')
+        self.client.run('search Hello/1.4.10@myuser/testing -q "os=Linux AND compiler.version=4.5"')
         self.assertNotIn("WindowsPackageSHA", self.client.out)
         self.assertNotIn("PlatformIndependantSHA", self.client.out)
         self.assertIn("LinuxPackageSHA", self.client.out)
 
-        self.client.run('search Hello/1.4.10/fenix/testing -q "compiler.version=1.0"')
-        self.assertIn("There are no packages for reference 'Hello/1.4.10@fenix/testing' "
+        self.client.run('search Hello/1.4.10@myuser/testing -q "compiler.version=1.0"')
+        self.assertIn("There are no packages for reference 'Hello/1.4.10@myuser/testing' "
                       "matching the query 'compiler.version=1.0'", self.client.out)
 
-        self.client.run('search Hello/1.4.10/fenix/testing -q "compiler=gcc AND compiler.version=4.5"')
+        self.client.run('search Hello/1.4.10@myuser/testing '
+                        '-q "compiler=gcc AND compiler.version=4.5"')
         self.assertNotIn("WindowsPackageSHA", self.client.out)
         self.assertNotIn("PlatformIndependantSHA", self.client.out)
         self.assertIn("LinuxPackageSHA", self.client.out)
 
-        self.client.run('search Hello/1.4.10/fenix/testing -q "arch=x86"')
+        self.client.run('search Hello/1.4.10@myuser/testing -q "arch=x86"')
         # One package will be outdated from recipe and another don't
-        self.assertEquals("""Existing packages for recipe Hello/1.4.10@fenix/testing:
+        self.assertEquals("""Existing packages for recipe Hello/1.4.10@myuser/testing:
 
     Package_ID: LinuxPackageSHA
         [options]
@@ -549,7 +564,7 @@ def package_search_properties_filter_test(self):
             os: Linux
         [requires]
             Hello2/0.1@lasote/stable:11111
-            HelloInfo1/0.45@fenix/testing:33333
+            HelloInfo1/0.45@myuser/testing:33333
             OpenSSL/2.10@lasote/testing:2222
         Outdated from recipe: False
 
@@ -565,18 +580,18 @@ def package_search_properties_filter_test(self):
 
 """, self.client.out)
 
-        self.client.run('search helloTest/1.4.10@fenix/stable -q use_OpenGL=False')
-        self.assertIn("There are no packages for reference 'helloTest/1.4.10@fenix/stable' "
+        self.client.run('search helloTest/1.4.10@myuser/stable -q use_OpenGL=False')
+        self.assertIn("There are no packages for reference 'helloTest/1.4.10@myuser/stable' "
                       "matching the query 'use_OpenGL=False'", self.client.out)
 
-        self.client.run('search helloTest/1.4.10@fenix/stable -q use_OpenGL=True')
-        self.assertIn("Existing packages for recipe helloTest/1.4.10@fenix/stable", self.client.out)
+        self.client.run('search helloTest/1.4.10@myuser/stable -q use_OpenGL=True')
+        self.assertIn("Existing packages for recipe helloTest/1.4.10@myuser/stable", self.client.out)
 
-        self.client.run('search helloTest/1.4.10@fenix/stable -q "use_OpenGL=True AND arch=x64"')
-        self.assertIn("Existing packages for recipe helloTest/1.4.10@fenix/stable", self.client.out)
+        self.client.run('search helloTest/1.4.10@myuser/stable -q "use_OpenGL=True AND arch=x64"')
+        self.assertIn("Existing packages for recipe helloTest/1.4.10@myuser/stable", self.client.out)
 
-        self.client.run('search helloTest/1.4.10@fenix/stable -q "use_OpenGL=True AND arch=x86"')
-        self.assertIn("There are no packages for reference 'helloTest/1.4.10@fenix/stable' "
+        self.client.run('search helloTest/1.4.10@myuser/stable -q "use_OpenGL=True AND arch=x86"')
+        self.assertIn("There are no packages for reference 'helloTest/1.4.10@myuser/stable' "
                       "matching the query 'use_OpenGL=True AND arch=x86'", self.client.out)
 
     def search_with_no_local_test(self):
@@ -627,19 +642,19 @@ def search_json_test(self):
                     'items': [
                         {
                             'recipe': {
-                                'id': 'Hello/1.4.10@fenix/testing'}
+                                'id': 'Hello/1.4.10@myuser/testing'}
                         },
                         {
                             'recipe': {
-                                'id': 'Hello/1.4.11@fenix/testing'}
+                                'id': 'Hello/1.4.11@myuser/testing'}
                         },
                         {
                             'recipe': {
-                                'id': 'Hello/1.4.12@fenix/testing'}
+                                'id': 'Hello/1.4.12@myuser/testing'}
                         },
                         {
                             'recipe': {
-                                'id': 'helloTest/1.4.10@fenix/stable'}
+                                'id': 'helloTest/1.4.10@myuser/stable'}
                         }
                     ]
                 }
@@ -665,19 +680,19 @@ def search_json_test(self):
                     'items': [
                         {
                              'recipe': {
-                                 'id': 'Hello/1.4.10@fenix/testing'}
+                                 'id': 'Hello/1.4.10@myuser/testing'}
                         },
                         {
                              'recipe': {
-                                 'id': 'Hello/1.4.11@fenix/testing'}
+                                 'id': 'Hello/1.4.11@myuser/testing'}
                         },
                         {
                              'recipe': {
-                                 'id': 'Hello/1.4.12@fenix/testing'}
+                                 'id': 'Hello/1.4.12@myuser/testing'}
                         },
                         {
                              'recipe': {
-                                 'id': 'helloTest/1.4.10@fenix/stable'}
+                                 'id': 'helloTest/1.4.10@myuser/stable'}
                         }
                     ]
                 },
@@ -686,19 +701,19 @@ def search_json_test(self):
                     'items': [
                         {
                             'recipe': {
-                                'id': 'Hello/1.4.10@fenix/testing'}
+                                'id': 'Hello/1.4.10@myuser/testing'}
                         },
                         {
                             'recipe': {
-                                'id': 'Hello/1.4.11@fenix/testing'}
+                                'id': 'Hello/1.4.11@myuser/testing'}
                         },
                         {
                             'recipe': {
-                                'id': 'Hello/1.4.12@fenix/testing'}
+                                'id': 'Hello/1.4.12@myuser/testing'}
                         },
                         {
                             'recipe': {
-                                'id': 'helloTest/1.4.10@fenix/stable'}
+                                'id': 'helloTest/1.4.10@myuser/stable'}
                         }
                     ]
                 }
@@ -719,19 +734,19 @@ def search_json_test(self):
                     'items': [
                         {
                             'recipe': {
-                                'id': 'Hello/1.4.10@fenix/testing'}
+                                'id': 'Hello/1.4.10@myuser/testing'}
                         },
                         {
                             'recipe': {
-                                'id': 'Hello/1.4.11@fenix/testing'}
+                                'id': 'Hello/1.4.11@myuser/testing'}
                         },
                         {
                             'recipe': {
-                                'id': 'Hello/1.4.12@fenix/testing'}
+                                'id': 'Hello/1.4.12@myuser/testing'}
                         },
                         {
                             'recipe': {
-                                'id': 'helloTest/1.4.10@fenix/stable'}
+                                'id': 'helloTest/1.4.10@myuser/stable'}
                         }
                     ]
                 }
@@ -740,7 +755,7 @@ def search_json_test(self):
         self.assertEqual(expected_output, output)
 
         # Test search packages local
-        self.client.run("search Hello/1.4.10@fenix/testing --json search.json")
+        self.client.run("search Hello/1.4.10@myuser/testing --json search.json")
         self.assertTrue(os.path.exists(json_path))
         json_content = load(json_path)
         output = json.loads(json_content)
@@ -752,7 +767,7 @@ def search_json_test(self):
                     'items': [
                         {
                             'recipe': {
-                                'id': 'Hello/1.4.10@fenix/testing'},
+                                'id': 'Hello/1.4.10@myuser/testing'},
                             'packages': [
                                 {
                                     'id': 'LinuxPackageSHA',
@@ -766,7 +781,7 @@ def search_json_test(self):
                                         'os': 'Linux'},
                                     'requires': [
                                         'Hello2/0.1@lasote/stable:11111',
-                                        'HelloInfo1/0.45@fenix/testing:33333',
+                                        'HelloInfo1/0.45@myuser/testing:33333',
                                         'OpenSSL/2.10@lasote/testing:2222'],
                                     'outdated': False
                                 },
@@ -793,7 +808,7 @@ def search_json_test(self):
                                         'os': 'Windows'},
                                     'requires': [
                                         'Hello2/0.1@lasote/stable:11111',
-                                        'HelloInfo1/0.45@fenix/testing:33333',
+                                        'HelloInfo1/0.45@myuser/testing:33333',
                                         'OpenSSL/2.10@lasote/testing:2222'],
                                     'outdated': True
                                 }
@@ -806,7 +821,7 @@ def search_json_test(self):
         self.assertEqual(expected_output, output)
 
         # Test search packages remote
-        self.client.run("search Hello/1.4.10@fenix/testing -r search_able --json search.json")
+        self.client.run("search Hello/1.4.10@myuser/testing -r search_able --json search.json")
         self.assertTrue(os.path.exists(json_path))
         json_content = load(json_path)
         output = json.loads(json_content)
@@ -818,7 +833,7 @@ def search_json_test(self):
                     'items': [
                         {
                             'recipe': {
-                                'id': 'Hello/1.4.10@fenix/testing'},
+                                'id': 'Hello/1.4.10@myuser/testing'},
                             'packages': [
                                 {
                                     'id': 'LinuxPackageSHA',
@@ -832,7 +847,7 @@ def search_json_test(self):
                                         'os': 'Linux'},
                                     'requires': [
                                         'Hello2/0.1@lasote/stable:11111',
-                                        'HelloInfo1/0.45@fenix/testing:33333',
+                                        'HelloInfo1/0.45@myuser/testing:33333',
                                         'OpenSSL/2.10@lasote/testing:2222'],
                                     'outdated': False
                                 },
@@ -859,7 +874,7 @@ def search_json_test(self):
                                         'os': 'Windows'},
                                     'requires': [
                                         'Hello2/0.1@lasote/stable:11111',
-                                        'HelloInfo1/0.45@fenix/testing:33333',
+                                        'HelloInfo1/0.45@myuser/testing:33333',
                                         'OpenSSL/2.10@lasote/testing:2222'],
                                     'outdated': True
                                 }
@@ -872,7 +887,7 @@ def search_json_test(self):
         self.assertEqual(expected_output, output)
 
         # Test search packages remote ALL
-        self.client.run("search Hello/1.4.10@fenix/testing -r all --json search.json")
+        self.client.run("search Hello/1.4.10@myuser/testing -r all --json search.json")
         self.assertTrue(os.path.exists(json_path))
         json_content = load(json_path)
         output = json.loads(json_content)
@@ -884,7 +899,7 @@ def search_json_test(self):
                     'items': [
                         {
                             'recipe': {
-                                'id': 'Hello/1.4.10@fenix/testing'},
+                                'id': 'Hello/1.4.10@myuser/testing'},
                             'packages': [
                                 {
                                     'id': 'LinuxPackageSHA',
@@ -898,7 +913,7 @@ def search_json_test(self):
                                         'os': 'Linux'},
                                     'requires': [
                                         'Hello2/0.1@lasote/stable:11111',
-                                        'HelloInfo1/0.45@fenix/testing:33333',
+                                        'HelloInfo1/0.45@myuser/testing:33333',
                                         'OpenSSL/2.10@lasote/testing:2222'],
                                     'outdated': False
                                 },
@@ -925,7 +940,7 @@ def search_json_test(self):
                                         'os': 'Windows'},
                                     'requires': [
                                         'Hello2/0.1@lasote/stable:11111',
-                                        'HelloInfo1/0.45@fenix/testing:33333',
+                                        'HelloInfo1/0.45@myuser/testing:33333',
                                         'OpenSSL/2.10@lasote/testing:2222'],
                                     'outdated': True
                                 }
@@ -938,7 +953,7 @@ def search_json_test(self):
                     'items': [
                         {
                             'recipe': {
-                                'id': 'Hello/1.4.10@fenix/testing'},
+                                'id': 'Hello/1.4.10@myuser/testing'},
                             'packages': [
                                 {
                                     'id': 'LinuxPackageSHA',
@@ -952,7 +967,7 @@ def search_json_test(self):
                                         'os': 'Linux'},
                                     'requires': [
                                         'Hello2/0.1@lasote/stable:11111',
-                                        'HelloInfo1/0.45@fenix/testing:33333',
+                                        'HelloInfo1/0.45@myuser/testing:33333',
                                         'OpenSSL/2.10@lasote/testing:2222'],
                                     'outdated': False
                                 },
@@ -979,7 +994,7 @@ def search_json_test(self):
                                         'os': 'Windows'},
                                     'requires': [
                                         'Hello2/0.1@lasote/stable:11111',
-                                        'HelloInfo1/0.45@fenix/testing:33333',
+                                        'HelloInfo1/0.45@myuser/testing:33333',
                                         'OpenSSL/2.10@lasote/testing:2222'],
                                     'outdated': True
                                 }
diff --git a/conans/test/functional/create_package_test.py b/conans/test/functional/create_package_test.py
--- a/conans/test/functional/create_package_test.py
+++ b/conans/test/functional/create_package_test.py
@@ -45,7 +45,7 @@ def complete_test(self):
         client.init_dynamic_vars()
         files = hello_source_files()
 
-        conan_ref = ConanFileReference.loads("Hello/1.2.1/frodo/stable")
+        conan_ref = ConanFileReference.loads("Hello/1.2.1@frodo/stable")
         reg_folder = client.paths.export(conan_ref)
 
         client.save(files, path=reg_folder)
diff --git a/conans/test/functional/scm_test.py b/conans/test/functional/scm_test.py
--- a/conans/test/functional/scm_test.py
+++ b/conans/test/functional/scm_test.py
@@ -214,7 +214,7 @@ def test_excluded_repo_fies(self):
         self.client.runner('git remote add origin "%s"' % path.replace("\\", "/"), cwd=path)
         self.client.run("create . user/channel")
         self.assertIn("Copying sources to build folder", self.client.out)
-        pref = PackageReference(ConanFileReference.loads("lib/0.1/user/channel"),
+        pref = PackageReference(ConanFileReference.loads("lib/0.1@user/channel"),
                                 NO_SETTINGS_PACKAGE_ID)
         bf = self.client.client_cache.build(pref)
         self.assertTrue(os.path.exists(os.path.join(bf, "myfile.txt")))
@@ -609,7 +609,7 @@ def test_excluded_repo_fies(self):
 
         self.client.run("create . user/channel")
         self.assertIn("Copying sources to build folder", self.client.out)
-        pref = PackageReference(ConanFileReference.loads("lib/0.1/user/channel"),
+        pref = PackageReference(ConanFileReference.loads("lib/0.1@user/channel"),
                                 NO_SETTINGS_PACKAGE_ID)
         bf = self.client.client_cache.build(pref)
         self.assertTrue(os.path.exists(os.path.join(bf, "myfile.txt")))
diff --git a/conans/test/model/ref_test.py b/conans/test/model/ref_test.py
--- a/conans/test/model/ref_test.py
+++ b/conans/test/model/ref_test.py
@@ -1,7 +1,7 @@
 import unittest
-from conans.model.ref import ConanFileReference, ConanName, InvalidNameException, check_valid_ref
+
 from conans.errors import ConanException
-from conans.model.ref import ConanFileReference, ConanName, InvalidNameException
+from conans.model.ref import ConanFileReference, ConanName, InvalidNameException, check_valid_ref
 from conans.model.ref import PackageReference
 
 
@@ -12,6 +12,7 @@ def basic_test(self):
         self.assertEqual(ref.version, "2.4.10")
         self.assertEqual(ref.user, "lasote")
         self.assertEqual(ref.channel, "testing")
+        self.assertEqual(ref.revision, None)
         self.assertEqual(str(ref), "opencv/2.4.10@lasote/testing")
 
         ref = ConanFileReference.loads("opencv_lite/2.4.10@phil_lewis/testing")
@@ -19,6 +20,7 @@ def basic_test(self):
         self.assertEqual(ref.version, "2.4.10")
         self.assertEqual(ref.user, "phil_lewis")
         self.assertEqual(ref.channel, "testing")
+        self.assertEqual(ref.revision, None)
         self.assertEqual(str(ref), "opencv_lite/2.4.10@phil_lewis/testing")
 
         ref = ConanFileReference.loads("opencv/2.4.10@3rd-party/testing")
@@ -26,8 +28,12 @@ def basic_test(self):
         self.assertEqual(ref.version, "2.4.10")
         self.assertEqual(ref.user, "3rd-party")
         self.assertEqual(ref.channel, "testing")
+        self.assertEqual(ref.revision, None)
         self.assertEqual(str(ref), "opencv/2.4.10@3rd-party/testing")
 
+        ref = ConanFileReference.loads("opencv/2.4.10@3rd-party/testing#rev1")
+        self.assertEqual(ref.revision, "rev1")
+
     def errors_test(self):
         self.assertRaises(ConanException, ConanFileReference.loads, "")
         self.assertRaises(ConanException, ConanFileReference.loads, "opencv/2.4.10")
@@ -45,6 +51,11 @@ def errors_test(self):
         self.assertRaises(ConanException, ConanFileReference.loads,
                           "opencv/2.4.10@laso/testing%s" % "A" * 40)
 
+        self.assertRaises(ConanException, ConanFileReference.loads, "opencv/2.4.10/laso/testing")
+        self.assertRaises(ConanException, ConanFileReference.loads, "opencv/2.4.10/laso/test#1")
+        self.assertRaises(ConanException, ConanFileReference.loads, "opencv@2.4.10/laso/test")
+        self.assertRaises(ConanException, ConanFileReference.loads, "opencv/2.4.10/laso@test")
+
     def revisions_test(self):
         ref = ConanFileReference.loads("opencv/2.4.10@lasote/testing#23")
         self.assertEqual(ref.channel, "testing")
@@ -137,4 +148,3 @@ def test_conanfileref(self):
         ref_pattern = ConanFileReference.loads("package/*@user/channel")
         self.assertFalse(check_valid_ref(ref_pattern, allow_pattern=False))
         self.assertTrue(check_valid_ref(ref_pattern, allow_pattern=True))
-