I'm trying to configure replication Mercurial hg server
I have a repository test1 and a subrepository test2
On the second server I run command
hg clone --noupdate https://user:password#sserver1/test1
hg clone --noupdate https://user:password#sserver1/test2
then hg pull
Download successful
Futher I clone repository on clint PC
hg clone https://user:password#sserver2/test1
and I get error authorization failed (in subrepository «test2»)
If open file .hgsub
test2 = https://server1/test2
instead, there should be
test2 = https://server2/test2
that is, the sub-repository error refers to the first server and should refer to the second
How do right setting replicatiom Mercurial hg?
Related
Closed: I started a hg clone... by error in the git repository and this created an empty hg repository. So hggit checks the differences with the empty hg repo and not the git conversion.
$ hg incoming -r branchname_bkm G1
comparing with /home/xxxx/src
abort: unknown revision 'branchname_bkm'
_bkm is the suffix I use between git branches and hg bookmarks.
I have a mercurial repository for long time (named HG0).
I converted it to git using the hggit extension, pushed it to gitlab.
I usually develop in the git repo (named G1) but our official repo is still mercurial.
When needed, I import a git branch (as bookmarks) this way:
update the hg-git map:
cd HG0
hg pull
hg update main_bkm # bookmark on default == main
hg git-cleanup
hg outgoing G1
import git branch:
hg in -r <branchname> G1
It worked perfectly during months.
For about 2 weeks, hg out shows me all the changesets, not only the new ones and hg in returns unknown revision!
I created a new git clone G2 from gitlab. hg out G2 is correct and only shows few revs as expected.
I could exchange my git branch from G1 to G2 and get it in HG0, ok.
How can I "re-synchronize" my hg repo with G1?
git-cleanup does not change anything.
I even tried to entirely rebuild the embedded .hg/git (~2 hours), no change.
If I grep a revision shown by hg out G1 in .hg/git-mapfile, it corresponds to the related revision in G1...
May git garbage collection process "hides" something used to identify the repo?
Thanks in advance.
I've just created a new Mercurial repo on my private server, but I can't push to it, and I can't figure out why.
Here's what I see:
% hg push
pushing to ssh://hg#mydomain.com//var/repos/myrepo
abort: no suitable response from remote hg!
On the server, the repo exists, and I can clone it locally:
root#mydomain:/tmp# hg clone /var/repos/myrepo repoclone
updating to branch default
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
I created the repo with hg init myrepo. It's owned by hg:hg, mod 755.
My workstation and server are both running
Mercurial Distributed SCM (version 4.4.1)
What else might be wrong?
Discovered you can add --debug to hg push.
% hg --debug push
pushing to ssh://hg#mydomain.com//var/repos/myrepo
running ssh 'hg#mydomain.com' 'hg -R /var/repos/myrepo serve --stdio'
sending hello command
sending between command
remote: This account is currently not available.
abort: no suitable response from remote hg!
I guess the server user must have a shell.
nano /etc/passwd
Changed
hg:x:999:1002:Mercurial repo owner:/home/hg:/usr/sbin/nologin
to
hg:x:999:1002:Mercurial repo owner:/home/hg:/bin/bash
And now it pushes!
I've some code on my laptop I would like to upload through Mercurial on my BitBucket repository.
I'm using a Linux CentOS 6 machine.
The problem is that if I type $hg push, I get the following error message:
pushing to default-push
abort: repository default-push not found!
What should I do?
Thanks
Mercurial doesn't know where you want to push to. Mercurial first looks for the destination in the push command (which could be either a repo on the filesystem, or a remote hg server):
hg push remoterepo
If it doesn't find a destination in the command, it will fall back on the defaults.
Normally, assuming this repository was cloned, the hgrc file (in .hg/) will indicate the default repository to be used.
However this assumes that the repository was created by cloning an existing repo.
If not, you can edit .hg\hgrc and add the default destination eg:
[paths]
default-push=http://yourserver/
I just lost my .hg* files for my repository after a migration and I have made a bunch of unpushed changes to some code.
I need to Init a new repository and then push my changes to an existing remote repository. Do I just need to init a new repo and then specify the remote repo in the hgrc and push? Thanks!
If you remember the changeset you had in your original repo as its working parent (let's call it A), then you can do this:
$ hg clone http://server/upstream newrepo
$ cd newrepo
$ hg up A
Then copy the working copy of the original repo to the new repo (with an additional precaution of deleting all files from the new repo if you renamed / deleted anything in the old repo). Afterwards, commit and push from the new repo:
$ hg commit
$ hg push
If the upstream repo has anything on top of A, rebase or merge before pushing.
how can I reset my local repository, to the state of remote one?
I have commited local changes (didn't push).
I want to delete all the differencies.
There are several options:
Make a new clone of the remote repo and throw away the old clone.
Make a new clone of the local repo, but limit it to the last revision in the remote. (e.g. hg clone -r <last remote changeset> <local_repo_old> <local_repo_new>).
Use the hg strip command from the mq extension to remove the changesets from your local repo
NOTE: When trying options 2 or 3, you can use the hg outgoing command to see which changesets have not yet been pushed to the remote repo.