Bug 1254249 - Provide a helpful description when Mercurial changesets can't be found, r=gps
MozReview-Commit-ID: BOR1pYltNRU
--- a/docs/mozreview/install-git.rst
+++ b/docs/mozreview/install-git.rst
@@ -125,16 +125,22 @@ Configuring a Repository to Submit to Mo
===============================================
Each local Git repository wishing to submit patches to MozReview will
need to be configured for MozReview integration. Configuring a
repository is simple::
$ git mozreview configure
+.. important::
+
+ MozReview only works with Git repository cloned from the Mercurial upstream.
+ `Documentation is available <https://github.com/glandium/git-cinnabar/wiki/Mozilla:-Using-a-git-clone-of-gecko%E2%80%90dev-to-push-to-mercurial#switching-to-git-cinnabar>`_
+ on how to switch a clone of ``gecko-dev`` mirror to ``hg.mozilla.org`` upstreams.
+
If you manually configured global settings above, this command should
complete automatically. If not, it will prompt you for e.g. your
Bugzilla access credentials.
By default, ``git mozreview configure`` will configure the ``review``
Git remote. See ``git mozreview configure help`` on how to change the
default remote name.
--- a/git/commands/git-mozreview
+++ b/git/commands/git-mozreview
@@ -608,16 +608,22 @@ def configure_command(args):
git_config[key]])
git_config['mozreview.remote'] = git_config[key]
ui.warn('warning: will not need the "%s" remote anymore;\n'
'You may remove it with `git remote remove %s`.\n'
% (remote, remote))
# Define the default remote url to use for pushing to MozReview.
if 'mozreview.remote' not in git_config:
+ res, output = get_output(['git', 'for-each-ref', 'refs/cinnabar'])
+ if res or output == '':
+ raise AbortError('A non-cinnabar clone is detected; '
+ 'please clone the repository from the Mercurial upstream '
+ 'with git-cinnabar, instead of from a Git mirror.')
+
ui.write('searching for appropriate review repository...\n')
# Query the special "autoreview" repo for the list of review repos.
url = '%s/autoreview/mozreviewreviewrepos' % args.mercurial_url
res = requests.get(url)
if res.status_code == 200:
data = res.json()
hg_shas = sorted(data.keys())
res, output = get_output(['git', 'cinnabar', 'hg2git'] + hg_shas)