Correct an error message where branch and url had changed places

With certain git remote problems an error message is emitted that
has the place of the url and the place of the branch wrong.

Example:
Remote "opera" for branch "git@github.com:operasoftware/gn-opera.git"
points to "bratell/no_jumbo_for_s", but it doesn't exist.

Should be:
Remote "opera" for branch "bratell/no_jumbo_for_s" points to
"git@github.com:operasoftware/gn-opera.git", but it doesn't exist.

R=dpranke@chromium.org

Change-Id: I484ac8af226903a49df1f62e837d01c345fb5f02
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1806595
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
changes/95/1806595/3
Daniel Bratell 6 years ago committed by Commit Bot
parent 9ccd057746
commit 4a60db4c3e

@ -1267,7 +1267,7 @@ class Changelist(object):
if not os.path.isdir(url):
logging.error(
'Remote "%s" for branch "%s" points to "%s", but it doesn\'t exist.',
remote, url, self.GetBranch())
remote, self.GetBranch(), url)
return None
cache_path = url

@ -3158,8 +3158,8 @@ class TestGitCl(TestCase):
(('os.path.isdir', '/cache/this-dir-doesnt-exist'),
False),
(('logging.error',
'Remote "origin" for branch "/cache/this-dir-doesnt-exist" points to'
' "master", but it doesn\'t exist.'), None),
'Remote "origin" for branch "master" points to'
' "/cache/this-dir-doesnt-exist", but it doesn\'t exist.'), None),
]
cl = git_cl.Changelist(issue=1)
self.assertIsNone(cl.GetRemoteUrl())

Loading…
Cancel
Save