Changeset - 000653f7cdf9
[Not reviewed]
beta
0 3 0
Mads Kiilerich - 13 years ago 2013-03-21 11:17:01
madski@unity3d.com
Transplanted from: 078d1badf39b
avoid displaying repr of internal classes in user facing messages

The context of the message will tell where the problem was and there is no reason to show
... does not exist for this repository <MercurialRepository at /home/marcink/repos/rhodecode>
3 files changed with 6 insertions and 8 deletions:
0 comments (0 inline, 0 general)
rhodecode/lib/vcs/backends/git/repository.py
Show inline comments
 
@@ -268,7 +268,7 @@ class GitRepository(BaseRepository):
 
                revision = self.revisions[int(revision)]
 
            except:
 
                raise ChangesetDoesNotExistError("Revision %r does not exist "
 
                    "for this repository %s" % (revision, self))
 
                    "for this repository" % (revision))
 

	
 
        elif is_bstr(revision):
 
            # get by branch/tag name
 
@@ -283,7 +283,7 @@ class GitRepository(BaseRepository):
 

	
 
            elif not pattern.match(revision) or revision not in self.revisions:
 
                raise ChangesetDoesNotExistError("Revision %r does not exist "
 
                    "for this repository %s" % (revision, self))
 
                    "for this repository" % (revision))
 

	
 
        # Ensure we return full id
 
        if not pattern.match(str(revision)):
rhodecode/lib/vcs/backends/hg/repository.py
Show inline comments
 
@@ -405,8 +405,8 @@ class MercurialRepository(BaseRepository
 
            revision = hex(self._repo.lookup(revision))
 
        except (IndexError, ValueError, RepoLookupError, TypeError):
 
            raise ChangesetDoesNotExistError("Revision %r does not "
 
                                    "exist for this repository %s" \
 
                                    % (revision, self))
 
                                    "exist for this repository"
 
                                    % (revision))
 
        return revision
 

	
 
    def _get_archives(self, archive_name='tip'):
rhodecode/tests/functional/test_files.py
Show inline comments
 
@@ -294,8 +294,7 @@ removed extra unicode conversion in diff
 
        msg = """Revision %r does not exist for this repository""" % (rev)
 
        self.checkSessionFlash(response, msg)
 

	
 
        msg = """%s""" % (HG_REPO)
 
        self.checkSessionFlash(response, msg)
 
        self.assertEqual('http://localhost/%s/files/tip/' % HG_REPO, response.headers['location'])
 

	
 
    def test_raw_file_wrong_f_path(self):
 
        self.log_user()
 
@@ -333,8 +332,7 @@ removed extra unicode conversion in diff
 
        msg = """Revision %r does not exist for this repository""" % (rev)
 
        self.checkSessionFlash(response, msg)
 

	
 
        msg = """%s""" % (HG_REPO)
 
        self.checkSessionFlash(response, msg)
 
        self.assertEqual('http://localhost/%s/files/tip/' % HG_REPO, response.headers['location'])
 

	
 
    def test_raw_wrong_f_path(self):
 
        self.log_user()
0 comments (0 inline, 0 general)