Is it possible to use the mercurial ACL extension to prevent specific users from cloning a repository? If so, how do you do it?
You don't need the ACL extension to prevent specific users from cloning. The allow_read and deny_read settings in the [web] section of a hgrc file grant/remove clone rights. Cloning is really just hg init ; hg pull under the covers.
http://www.selenic.com/mercurial/hgrc.5.html#web
Related
I have a mercurial queue patch on my local machine that I need to share with a coworker that I'd prefer not to commit to an upstream repository. Is there a simple way that I can package that patch and share it with him?
mq stores the patches in the .hg\patches\ folder as files without an extension.
You can copy or email those files and use hg qimport FILE on the other end to bring them into the patch queue on the other repository. Note that if you copy it directly to the target .hg\patches\ folder, you'll need to use the --existing switch so hg knows to not create the file.
The .hg/patches folder, by the way, can be a repository in itself to track changes in the patch queue itself. You can init it with hg init --mq and commit the current patches by hg com --mq.
If both sides have MQ enabled, you can use for pull|push --mq option
You can use MQCollab extension
You can just copy needed mq-patch from patch-directory (default: `.hg/patches) and transfer it using any way: patch is ordinary diff, which can be applied to "foreign" files in repository even without MQ
I can delete remote branches in Git using git push. (See How do I delete a remote branch in Git?). But I can't do the equivalent using Mercurial bookmarks.
I've tried hg bookmark -d something, but when I push to a Git repository using hg-git, it does not delete the bookmark on the remote repository.
When I try hg bookmark -d origin/something, it complains that it doesn't exist.
To delete a bookmark from a remote server, you must have permission to push to the server. If you can push to it, then you can:
hg bookmark --delete <bookmark name>
hg push --bookmark <bookmark name>
See the "Working With Remote Repositories" section of the Mercurial BookmarksExtension wiki for further info.
NOTE: This only removes the bookmark itself. It does not remove any changesets that were associated with the bookmark. If you need to remove the changesets themselves, then you must consider other methods as noted in these related questions.
With hg-git it is not possible at the moment.
You have to install the git client, clone the repo and issue a
git push origin :oldbranch
to delete the old branch. Hopefully there will be a patch one day.
I keep all my personal projects on my Kiln account and I also have a bitbucket account where I push repositories when I need to share them with people. Is there some way for me to setup an alias for a repo URL so I can do something like
hg push kiln
or
hg push bitbucket
instead of typing in the entire URL each time:
hg push https://path/to/repo
Yes, you can do this in your repo's hgrc file using the paths section.
[paths]
default = https://path/to/repo
kiln = https://path/to/kiln
bitbucket = https://path/to/bitbucket
If you create new repos often, you can also add this to your ~/.hgrc file.
When a project is started with
mkdir proj
cd proj
hg init
[create some files]
hg add file.txt
hg commit
hg push ssh://me#somewhere.somehost.com/proj
now when hg path is issued, nothing will show. How do we actually change the repository so that it is as if it is cloned from me#somewhere.somehost.com/proj ? Is it just by editing .hg/hgrc and adding
[paths]
default = ssh://me#somewhere.somehost.com/proj
because that feels like too low level an operation to do (by editing a text file)
It's the only way to do it in this situation. There are plenty of other cases where you have to edit the hgrc by hand, like setting up hooks or enabling extensions, so it's not as if it's unusual.
(As you probably already know, hg clone will set the path entry in the clone to point back to the original.)
I have a centralized Mercurial repository which I want to provide access to via SSH.
I did a chown root:developers repository -R on the repository directory, so all users in group 'developers' should have access.
So, I clone, add my initial files to the repository as user A, commit, push, done. Now, I go as user B, clone, add a file, commit, and push. But then, when I do a pull, an update, and change that file as user A and then try to push, I get
pushing to /var/hg/repository
searching for changes
1 changesets found
adding changesets
adding manifests
adding file changes
transaction abort!
rollback completed
abort: Permission denied: /var/hg/repository/.hg/store/data/test.i
Am I missing a configuration step? Should I not be using SSH?
EDIT I found that using the sticky bit solves the problem: How to set permissions so two users can work on the same hg repository?. Is this a bad solution?
Sticky group bit is the right way to do this. Also, it used to be the case that user's umasks needed to be set such that group read/write would be on for new files they add, but for the last year or two mercurial copies the permissions (not ownership) of the .hg directory in the repo itself on to newly created files, so the umask isn't as important.
Maybe you could be interested by mercurial-server: http://www.lshift.net/mercurial-server.html
mercurial-server is useful if you don't want to provide a shell to developers on server hosting mercurial central repository.
The Mercurial documentation says using the setgid flag is okay.