Status of mercurial+ssh support

267 views
Skip to first unread message

Mark Wang

unread,
Jul 13, 2011, 7:18:33 PM7/13/11
to reviewboard
Hi all -- does Reviewboard currently support remote mercurial repos
over ssh? I had read messages on this list from 2009 saying that such
support didn't exist but haven't seen any updates yet about this.

I tried setting up a remote hg repo via ssh (keys, etc. are all OK,
and I can rbssh from the command line), and got this error.

If it's supported, is there anything that might be going wrong? If hg
+ssh isn't in there yet, that's fine -- just wanted to know. Thanks!

Mark


File "/usr/lib/python2.4/site-packages/Django-1.2.1-py2.4.egg/django/
core/handlers/base.py", line 100, in get_response
response = callback(request, *callback_args, **callback_kwargs)

File "/usr/lib/python2.4/site-packages/Django-1.2.1-py2.4.egg/django/
views/decorators/cache.py", line 69, in _wrapped_view_func
response = view_func(request, *args, **kwargs)

File "/usr/lib/python2.4/site-packages/Django-1.2.1-py2.4.egg/django/
views/decorators/vary.py", line 22, in inner_func
response = func(*args, **kwargs)

File "/usr/lib/python2.4/site-packages/Djblets-0.6.7-py2.4.egg/
djblets/webapi/resources.py", line 289, in __call__
result = view(request, api_format=api_format, *args, **kwargs)

File "/usr/lib/python2.4/site-packages/Djblets-0.6.7-py2.4.egg/
djblets/webapi/resources.py", line 415, in post
return self.create(*args, **kwargs)

File "/usr/lib/python2.4/site-packages/Djblets-0.6.7-py2.4.egg/
djblets/webapi/decorators.py", line 88, in _checklogin
return view_func(*args, **kwargs)

File "/usr/lib/python2.4/site-packages/Djblets-0.6.7-py2.4.egg/
djblets/webapi/decorators.py", line 62, in _call
return view_func(*args, **kwargs)

File "/usr/lib/python2.4/site-packages/Djblets-0.6.7-py2.4.egg/
djblets/webapi/decorators.py", line 224, in _validate
return view_func(*args, **new_kwargs)

File "/usr/lib/python2.4/site-packages/ReviewBoard-1.5.5-py2.4.egg/
reviewboard/webapi/resources.py", line 1125, in create
form = UploadDiffForm(review_request, form_data, request.FILES)

File "/usr/lib/python2.4/site-packages/ReviewBoard-1.5.5-py2.4.egg/
reviewboard/reviews/forms.py", line 230, in __init__
data, *args, **kwargs)

File "/usr/lib/python2.4/site-packages/ReviewBoard-1.5.5-py2.4.egg/
reviewboard/diffviewer/forms.py", line 44, in __init__
if self.repository.get_scmtool().get_diffs_use_absolute_paths():

File "/usr/lib/python2.4/site-packages/ReviewBoard-1.5.5-py2.4.egg/
reviewboard/scmtools/models.py", line 56, in get_scmtool
return cls(self)

File "/usr/lib/python2.4/site-packages/ReviewBoard-1.5.5-py2.4.egg/
reviewboard/scmtools/hg.py", line 29, in __init__
self.client = HgClient(repository.path)

File "/usr/lib/python2.4/site-packages/ReviewBoard-1.5.5-py2.4.egg/
reviewboard/scmtools/hg.py", line 179, in __init__
self.repo = hg.repository(hg_ui, path=repoPath)

File "/usr/lib/python2.4/site-packages/mercurial-1.8-py2.4-linux-
x86_64.egg/mercurial/hg.py", line 94, in repository
repo = _lookup(path).instance(ui, path, create)

File "/usr/lib/python2.4/site-packages/mercurial-1.8-py2.4-linux-
x86_64.egg/mercurial/sshrepo.py", line 52, in __init__
self.validate_repo(ui, sshcmd, args, remotecmd)

File "/usr/lib/python2.4/site-packages/mercurial-1.8-py2.4-linux-
x86_64.egg/mercurial/sshrepo.py", line 83, in validate_repo
self._abort(error.RepoError(_("no suitable response from remote
hg")))

File "/usr/lib/python2.4/site-packages/mercurial-1.8-py2.4-linux-
x86_64.egg/mercurial/sshrepo.py", line 104, in _abort
raise exception

RepoError: no suitable response from remote hg

Gilles Moris

unread,
Jul 14, 2011, 5:34:26 AM7/14/11
to revie...@googlegroups.com, Mark Wang
On Thursday 14 July 2011 01:18:33 am Mark Wang wrote:
> Hi all -- does Reviewboard currently support remote mercurial repos
> over ssh? I had read messages on this list from 2009 saying that such
> support didn't exist but haven't seen any updates yet about this.
>
> I tried setting up a remote hg repo via ssh (keys, etc. are all OK,
> and I can rbssh from the command line), and got this error.
>
> If it's supported, is there anything that might be going wrong? If hg
> +ssh isn't in there yet, that's fine -- just wanted to know. Thanks!
>
> Mark
>

To my knowledge, nothing more than my reply in that post:
http://groups.google.com/group/reviewboard/browse_thread/thread/d2ba3808e0c8304c/4221300c55e5cd80

So still not possible.

Regards.
Gilles.

Christian Hammond

unread,
Apr 16, 2013, 3:34:58 PM4/16/13
to revie...@googlegroups.com, Mark Wang, revie...@googlegroups.com

Can you look for any related errors in reviewboard.log?


We test this in our test suite, so I'd expect it to work. Could be an issue invoking rbssh.

Christian


On Mon, Apr 8, 2013 at 1:11 AM, jimmy jiang <jimmy....@gmail.com> wrote:

I am using rb1.7.6 and ssh:// hg repo, and still found the auhentication is ok based on ssh key when create repo in reviewboard, but when i upload diff into review request, it still report as below error:

the file ...... (revision ####) was not found in the repository.

is rb still not working well on ssh:// rg repo? thanks,

Jimmy

在 2011年7月14日星期四UTC+8下午5时34分26秒,morisgi写道:

--
Want to help the Review Board project? Donate today at http://www.reviewboard.org/donate/
Happy user? Let us know at http://www.reviewboard.org/users/
-~----------~----~----~----~------~----~------~--~---
To unsubscribe from this group, send email to reviewboard...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/reviewboard?hl=en
---
You received this message because you are subscribed to the Google Groups "reviewboard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to reviewboard...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

jimmy jiang

unread,
Apr 19, 2013, 8:35:35 PM4/19/13
to revie...@googlegroups.com, Mark Wang
Thanks. it is good to hear it works in your test suite. i will further check.
i want to add some logs in rb source code in the installed review board dir (/usr/local/lib/python2.7/dist-packages/Reviewboard-1.7.6.**.egg/reviewboard/), it seems failed to take effective. how can i change the local review board source code for further checking? thanks,

BR
Jimmy

在 2013年4月17日星期三UTC+8上午3时34分58秒,Christian Hammond写道:

Christian Hammond

unread,
Apr 20, 2013, 1:55:54 AM4/20/13
to revie...@googlegroups.com, Mark Wang
How does it fail? That should work, in theory, so long as you're importing the logging module in that file.

Christian

--
Christian Hammond - chi...@chipx86.com
Review Board - http://www.reviewboard.org
Beanbag, Inc. - http://www.beanbaginc.com

jimmy jiang

unread,
May 26, 2013, 7:02:49 PM5/26/13
to revie...@googlegroups.com
Christian,

After add logging and i find where is the problem is. it is same with the issue in below link:

I setup ssh based mercurial repo with reviewboard, when i try to upload diff file to RB, it reports error which is same with above one: 'sshrepository' object has no attribute 'changectx'. thank you for your support.

BR
Jimmy



2013/4/20 Christian Hammond <chi...@chipx86.com>
You received this message because you are subscribed to a topic in the Google Groups "reviewboard" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/reviewboard/KdUBotLYk1k/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to reviewboard...@googlegroups.com.

Christian Hammond

unread,
May 27, 2013, 12:09:02 AM5/27/13
to revie...@googlegroups.com, revie...@googlegroups.com
Hi Jimmy,

Can you provide here the following info

1) RB version
2) Version of bzr on the server
3) The full traceback and related reviewboard.log entries for this error
4) The command line you're using for generating the diff 
4) Ideally, a diff you can show me that reproduces this problem

Thanks!

Christian

jimmy jiang

unread,
May 27, 2013, 6:53:33 PM5/27/13
to revie...@googlegroups.com
Christian,
 
As below info, thanks,

1) RB version
v1.7.6

2) Version of bzr on the server
i use ubuntu linux v12, mercurial version v2.2.2. 
Does bzy means bug tracker? no bug tracker set for me.

3) The full traceback and related reviewboard.log entries for this error
pls refer to the attached reviewboard.log, the last in which is the exception info in ./reviewboard/scmtool/hg.py. 
the hg.py source file also attached.

4) The command line you're using for generating the diff 
=> cmd line:    post-review -d -p -r 8 -diff-filename=/home/jimmy/a1.patch
the a1.patch also attached.
and also 2 cfg files in working dir attached: hgrc and .reviewboardrc
reviewboard.log
.reviewboardrc
a1.patch
hg.py

jimmy jiang

unread,
May 27, 2013, 7:06:51 PM5/27/13
to revie...@googlegroups.com
one more attachment of hgrc, thanks.

BR
Jimmy



2013/5/28 jimmy jiang <jimmy....@gmail.com>
hgrc

Christian Hammond

unread,
May 29, 2013, 2:43:40 PM5/29/13
to revie...@googlegroups.com
Hi Jimmy,

Sorry, I meant mercurial and not bzr. Thanks for the correct info :)

Can you try upgrading the server's copy of mercurial? It looks like we're expecting a newer version, which may be the reason you're having the problem. That "sshrepository" object mentioned is gone, and I want to see if it still reproduces and what the new error is.

Thanks,

Christian

--
Christian Hammond - chi...@chipx86.com
Review Board - http://www.reviewboard.org


jimmy jiang

unread,
May 30, 2013, 7:05:05 PM5/30/13
to revie...@googlegroups.com
Hi. Christian,

I updated the mercurial to latest v2.6.1. but new error happened,
It is "Abort: repository 'ssh://h...@135.251.206.233/AONT_R2X_MS' is not local" , which is the earlier to the original error.
The reviewboard.log attached, please help to check, thanks.

BR
Jimmy.

reviewboard.log

jimmy jiang

unread,
Jun 11, 2013, 10:08:57 AM6/11/13
to revie...@googlegroups.com
Hi, Christian,

For the above error of ""Abort: repository 'ssh://h...@135.251.206.233/AONT_R2X_MS' is not local"", i did below change for this issue:
in ./reviewboard/scmtool/hg.py, calss HgClient, __init__(self, repoPath, local_site),
change self.repo = hg.repository (hg_ui, path+repoPath)
to => self.repo = hg.peer (hg_ui, {}, path=repoPath)

After this, i got the same error point ('sshpeer' object has no attribute 'changectx'.) as before, it means the same error happen after i upgraded mercurial from v2.2.2 to v2.6.1.

Thanks for your support.

BR
Jimmy


2013/5/31 jimmy jiang <jimmy....@gmail.com>

hnhn

unread,
Mar 6, 2014, 8:36:13 AM3/6/14
to revie...@googlegroups.com
Hi,

the "Abort: repository ..
is not local" message
is one you get when trying to run local-only commands
on remote repositories, such as 'hg cat' or 'hg log'. Looking why I'm getting similar failures as Jimmy
describes in his first email here, this is what hg.py is doing - calling 'hg cat' on a remote repo.
Here's the relevant debug log (adding the command debug to hg.py) [ReviewBoard 1.7.22]:

2014-03-06 13:14:17,557 - DEBUG -  - ['hg', '--noninteractive', '--repository', u'ssh://USER@HOST/PATH_redacted', '--cwd', u'ssh://USER@HOST/PATH_redacted', 'showconfig', 'ui.ssh']
2014-03-06 13:14:17,606 - DEBUG -  - Using rbssh for mercurial:
2014-03-06 13:14:17,606 - DEBUG -  - ['hg', '--noninteractive', '--repository', u'ssh://USER@HOST/PATH_redacted', '--cwd', u'ssh://USER@HOST/PATH_redacted', '--config', 'ui.ssh=rbssh', 'cat', '--rev', 'REV_redacted', 'FILE_PATH_redacted']

References:
  http://mercurial.selenic.com/wiki/FAQ#FAQ.2FCommonProblems.How_can_I_do_a_.22hg_log.22_of_a_remote_repository.3F
  http://selenic.com/pipermail/mercurial/2008-July/019954.html

hnhn
Reply all
Reply to author
Forward
0 new messages