From nobody Fri Oct 22 09:40:57 2021 X-Original-To: freebsd-questions@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 9AAB0180768A for ; Fri, 22 Oct 2021 09:41:05 +0000 (UTC) (envelope-from gray@nxg.name) Received: from smtp72.iad3b.emailsrvr.com (smtp72.iad3b.emailsrvr.com [146.20.161.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4HbK9F45Qhz4kg0 for ; Fri, 22 Oct 2021 09:41:05 +0000 (UTC) (envelope-from gray@nxg.name) X-Auth-ID: gray@nxg.name Received: by smtp2.relay.iad3b.emailsrvr.com (Authenticated sender: gray-AT-nxg.name) with ESMTPSA id EDEFB20083; Fri, 22 Oct 2021 05:40:58 -0400 (EDT) From: Norman Gray To: Dale Scott Cc: freebsd-questions Subject: Re: share Mercurial repo's in user home directory Date: Fri, 22 Oct 2021 10:40:57 +0100 X-Mailer: MailMate (1.14r5818) Message-ID: <2C8C7BF1-AA56-4CD5-884B-7795457665DA@nxg.name> In-Reply-To: <116710303.120952109.1634857755619.JavaMail.zimbra@shaw.ca> References: <116710303.120952109.1634857755619.JavaMail.zimbra@shaw.ca> List-Id: User questions List-Archive: https://lists.freebsd.org/archives/freebsd-questions List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org MIME-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable X-Classification-ID: 303e7275-1656-4c40-a05f-49995df226f2-1-1 X-Rspamd-Queue-Id: 4HbK9F45Qhz4kg0 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N Dale, hello. On 22 Oct 2021, at 0:09, Dale Scott wrote: > This is not directly related to FreeBSD.... is it possible to share a = Mercurial repository with remote users simply by putting it in a user dir= ectory and the remote users specifying the ssh protocol in their hg clone= , pull, push... commands? Yes, this works fine. I do this in a couple of different variants. > I successfully do this now with git for a small number of users. I cre= ated a new system user and put headless git repos in the new user's home = directory, then added a public ssh key for each developer to the new user= 's authorized_keys file. Remote users access the git repos in the home di= rectory by simply using the ssh syntax with git clone, pull and push (and= authenticate using their private key). > > Does this also work with Mercurial? Do you mean a user 'hg', say, which has in its home directory user1/repo1= , user1/repo2, user2/repo1, and so on? You'd clone those with % hg clone ssh://hg@myhost/user1/repo1 which would result in a directory `repo1/` on the client user's machine, = with that URI retained as the default remote repo for pull and push and f= riends. The one mild gotcha with that syntax is that the directory path = is relative to the home directory of the connecting user 'hg' (as you'd e= xpect), so that if the repos were for some reason elsewhere, you'd specif= y this with ssh://hg@myhost//path/to/repo, with an extra slash indicating= the root directory. You can either do % cd ~hg/user1/repo1 % hg init and push to the above URI, or you can simply copy the .hg/ from an existi= ng repo into place (as you'd expect). That is: there are no surprises he= re, and all of the state in a repo is indeed contained in the .hg file at= the root. The final remark is that you should probably have this remote repo as a '= publishing' repo (which is what happens by default when you do `hg init`)= =2E When you push local revisions to a publishing repo, they are changed= from 'draft' to 'public' phase. One of the nice things about Mercurial is that 'as you'd expect' is a phr= ase that comes up a lot. Best wishes, Norman -- = Norman Gray : https://nxg.me.uk