hg - what to do when hg push times out - mercurial

UPDATE - I'm probably being daft, see my last update below.
I just did a hg push and it timed out, and now when I try hg push again I get a message 'no changes found', however I can see in the target repo that all but a few of the changes didn't make it to the repo. How can I push my changes to that repo?
The history behind this is I'm migrating from SVN to Mercurial (bitbucket). I've done the following:
Used svnsync to get a local copy of the SVN repository.
Created a new repo within bitbucket
Cloned the repo to my local machine
Done svnadmin convert from my local SVN repo to my local Hg repo
Run hg push to push the changes to bitbucket
The last command prompts me for HTTP authorisation, then says 'searching for changes', no output for >15 mins, then output 'abort: HTTP Error 504: Gateway Time-out'. Full process was:
C:\dev\sandbox\svn_to_hg\dev_hg>hg push
http authorization required
realm: Bitbucket.org HTTP
user: my_login
password:
pushing to https://bitbucket.org/my_login/dev
searching for changes
abort: HTTP Error 504: Gateway Time-out
C:\dev\sandbox\svn_to_hg\dev_hg>hg push
http authorization required
realm: Bitbucket.org HTTP
user: my_login
password:
pushing to https://bitbucket.org/my_login/dev
searching for changes
no changes found
It seems that because there are so many changes it's taking too long between HTTP auth and when it actually pushes the changes, or something like that, and probably if I set up SSH keys it'd not need to cache the HTTP authentication so it wouldn't time out. Any ideas if that's correct? Regardless, I still need to know how to push these changes that hg now thinks have already been pushed.
In my bitbucket repository there are about 20 changesets from SVN from a few years ago, but there should be several thousand.
UPDATE:
hg out gives me this:
C:\dev\sandbox\svn_to_hg\dev_hg>hg out
http authorization required
realm: Bitbucket.org HTTP
user: my_login
password:
comparing with https://bitbucket.org/my_login/dev
searching for changes
no changes found
Looking at the repo using TortoiseHg repo browser shows there is tons of stuff there.
UPDATE:
Perhaps I'm being daft, now when I look at the repo within bitbucket it does seem that there are lots of changesets. But what timed out? Should I worry that all my changesets didn't make it to the server?

It seems that all changesets did make it - i.e. answer is to retry and then trust Mercurial.

Related

Unable to push to a Bitbucket Mercurial Repository

I am using SourceTree with Bitbucket.
I used to be able to push without errors.
Now I get
hg push --new-branch default
pushing to https://bitbucket.org/myusername/myrepository/branch/default
abort: HTTP Error 404: Not Found
Completed with errors, see above.
I can see the repository in the browser.
I can push from a different machine. It works correctly on a machine where the url is myusername#bitbucket.org/myusername/myrepository.
You have to drop the branch/default part of the URL. The canonical repository URL is https://bitbucket.org/myusername/myrepository/.
For some reason, bitbucket allows read operations from URL/more/stuff but not write operations.

Mercurial/TortoiseHg responds with "abort: destination does not support push"

I want to push a repository from my computer to a repository on a remote site for the purpose of synchronizing the files. TortoiseHg seems to correctly identify outgoing changesets, but when I try to push the changes, TortoiseHg responds with "abort: destination does not support push" with "Push to https://myid:ps#mydomain.com aborted, ret 255" in the status bar at the bottom. The log file includes "(falling back to static-http)"
I've googled but I'm getting nowhere. What does "abort: destination does not support push" mean in English? What doesn't support push? What is the "destination"? Is it the settings in the config files in the repo that make it so the destination doesn't support push? Is it the way the server is set up?
One of the responses to 27967022 "Your destination does not support push, or push is disabled" So how does one enable push?
If you use hgweb on the server side, to allow pushing to a repository, add
[web]
allow_push = *
to its .hg/hgrc on the server or in your hgweb.config. You can also allow pushing only for specific users by listing them instead of *. This is documented here.
If that is not the case and you just use the https server to serve the repo as files, you'll not be able to push via https. In that case, your most likely option is to push via ssh, as in
hg push ssh://myid#mydomain.com/path/to/repo
This requires that you have ssh access to the server and that the repository lies in $HOME/path/to/repo. For an absolute path (if the repository lies in /path/to/repo and not below $HOME), push to ssh://myid#mydomain.com//path/to/repo (note the double slash).
If you always push to the same destination, you can add this path to your local .hg/hgrc:
[paths]
default-push = ssh://myid#mydomain.com/path/to/repo
so that you can then just use hg push.
What are you running for your mercurial server on mydomain.com? If it's hgweb, then #wintermute has your answer. If you're serving static HTTP (using Apache, nginx, etc.) then your server is setup for clone or pull, but not push. More likely you just need to enable push like #wintermute is saying.

Using subrepositories with bitbucket

I have encountered this error when trying to push a subrepository to bitbucket:
D:\Work\agile.crm.framework>hg push
warning: bitbucket.org certificate with fingerprint 81:2b:08:90:dc:d3:71:ee:e0:7
c:b4:75:ce:9b:6c:48:94:56:a1:fe not verified (check hostfingerprints or web.cace
rts config setting)
http authorization required
realm: Bitbucket.org HTTP
user: the_drow
password:
warning: bitbucket.org certificate with fingerprint 81:2b:08:90:dc:d3:71:ee:e0:7
c:b4:75:ce:9b:6c:48:94:56:a1:fe not verified (check hostfingerprints or web.cace
rts config setting)
pushing to https://the_drow#bitbucket.org/the_drow/agile.crm.framework
pushing subrepo Logging to https://the_drow#bitbucket.org/the_drow/agile.crm.fra
mework/Logging
warning: bitbucket.org certificate with fingerprint 81:2b:08:90:dc:d3:71:ee:e0:7
c:b4:75:ce:9b:6c:48:94:56:a1:fe not verified (check hostfingerprints or web.cace
rts config setting)
abort: HTTP Error 404: NOT FOUND
I have encountered this link that describes how to solve the problem but I don't understand what to do.
Should I place my Logging subrepository in D:\Work\?
What exactly should I do with the mercurial subpaths? Will this enable me to clone locally?
EDIT:
As requested, here are the contents of my .hgsub file
Logging = Logging
As noted in the link that you posted, "You have to make the subrepositories as siblings of the main repository."
So on BitBucket, you need the following structure:
https://bitbucket.org/the_drow/agile.crm.framework
https://bitbucket.org/the_drow/Logging
Then your .hgsub inside agile.crm.framework needs to contain the following:
Logging = ../Logging
I'm going to bump an old question because I think I have a better solution. I understand why #the_drow has issues with the original accepted answer since with Logging = ../Logging your local machine has to have the Logging subrepo as a peer with the containing/master repo. This kind of defeats the purpose of subrepos from an organization point of view. However, if you use the subpaths feature, you can get Mercurial to rewrite the URI for you on push:
external/my_subrepo = external/my_subrepo
[subpaths]
([https://|ssh://hg#])bitbucket\.org/moswald/my_project/external/my_subrepo = \1bitbucket.org/moswald/my_subrepo
Now my local copy of the my_subrepo sub repository is stored inside my_project as expected, but when I push to Bitbucket, it's rerouted to the real thing. In fact, you can use that rewriting feature to point pretty much anywhere since Mercurial understands Git and SVN. I've got more than a few Bitbucket repositories that have subrepos by other authors who use Github.

Unbundle throws " abort: error: ftp error: no host given" when using a local network share with an UNC path

Before explaining my problem let me tell you the Mercurial setup,
We have the following repos,
RELEASE
DEVELOPMENT
BUGFIX
All the above repo are running on a central server using IIS and hgwebdir.cgi
Now coming to the problem,
I clone a local repo from DEVELOPMENT repo.
I make changes to the clone and commit (Not push).
I make a bundle from the clone and pass the bundle to QA who has cloned the RELEASE repo.
Now I try to apply the bundle to the RELEASE repo clone using hg unbundle
I get an error, abort: error: ftp error: no host given
What am I doing wrong? Can you give solution to the above problem keeping a Windows setup in mind?
It really sounds like you have a syntax error in your unbundle command. The normal usage is just:
hg unbundle c:\path\to\the.bundle
there's no ftp involved unless you're trying to use a ftp:// URL which isn't supported. Is it possible you have a directory named ftp and the parser is mistakign it for a component in a ftp URL?
Also, most folks wouldn't use bundles in the scenario you're describing. They'd just do:
hg push URL-or-file-path-to-QA
and push direct to QA's own repo (not to RELEASE)
People generally use bundles only when a network connection isn't possible or practical.
I experienced the same problem, I don't think hg likes uncs.
I mapped \server\DevSourceCode\Mercurial to R: and it worked fine, see below:
R:\Repositories\myproj>hg unbundle \\server\DevSourceCode\Mercurial\ChangeBundles\myproj_changes.hg
abort: error: ftp error: no host given
R:\Repositories\myproj>hg unbundle R:\ChangeBundles\myproj_changes.hg
adding changesets
adding manifests
adding file changes
added 0 changesets with 0 changes to 139 files
(run 'hg update' to get a working copy)

Can not clone mercurial (hg) repository via http

I can't clone my repository via http:
abort: 'http://MYREPO' does not appear to be an hg repository!
Firstly, I created a new repo by hg init MYREPO followed by adding some file and commit.
The dir with my repo is password protected but there is no sign of problem because of it, I tried both methods of cloning:
(on my local machine)
hg clone http://MYREPO my_repo
and
hg clone http://user:password#MYREPO my_repo
Permissions of repo dir are: drwxrwxr-x
I can clone this very repository on my remote machine (the same repo is on) without any problems.
What could be possibly wrong?
UPDATE:
Looks like you're getting confusing between repository and hostname
If running "hg serve", "hg clone http://USER#HOST:8000" where host can be you machine's IP or the hostname (type "hostname" on linux or try "ping localhost"). You can change the default port from 8000 by passing a --port #### to hg serve.
If you want to do it over ssh, "hg clone ssh://USER#HOST//PATH/TO/YOUR/REPOSITORY". Suppose you made an repository in your home directory called MYREPO then you would do this: "hg clone ssh://USER#HOST/~/MYREPO"
You can only clone your repo via http is something is serving that repo over http. Mercurial provides a built in http server for you. Run "hg serve" while inside of your repo then attempt to clone it from another location (or another command shell). If you just want a local clone, you don't need to use http ("hg clone ").
Also, try "hg help clone" and "hg help serve" for details.
weirdly, cloning with ssh requires a non-intuitive extra forward slash.
this works for me on a host with ssh running on port 43211
hg clone ssh://example.com:43211//repos/myRepo ./myRepo
the double slash after the port number works, but a single slash there results in the ".hg not found" error
besszero is right, but why don't you clone using SSH if you are gonna use username and password anyway?
hg clone ssh://machine_ip//your/repo/location your_repo
It's also safer if you don't want to open another port for mercurial's http server and you don't need the hgweb features, the traffic is also encrypted. The only con is that you have to log in to checkout, but HTTP doesn't work for pushing back the changes, at least not in my experience.
Argh... One need to be careful with .htaccess configuration. In my case I needed to add 'hgwebdir.cgi' to the path to clone... Thanks for the answers though!
SSH seems logical but somehow I couldn't use it with user other than my local:
hg clone ssh://MY_REMOTE_USER#MYREPO
remote: abort: There is no Mercurial repository here (.hg not found)!