Can't I use hg update offline? - mercurial

When I use Mercurial and try to do a
hg update --repository C:\Projekt\Learnify\Systems\myapp -rev 271 --check
without network connection I get
"URLError getaddrinfo failed".
Shouldn't I be able to to this since the actual repository is on my computer?

another guess is that you have a subrepository reference in your repository that has an absolute path to a remote location and you are updating to a changeset in your parent repository that references a changeset in the subrepository that you don't have locally, so it is trying to do a pull on that remote repository that is referenced as a subrepository. so what is preventing your update is not a need to connect to a remote repository for your repository itself, but for the subrepository that is referenced absolutely.

try
hg update --repository file://C:\Projekt\Learnify\Systems\myapp -rev 271 --check
to tell Hg it is not a network protocol URI

My guess is that you are using a shared repository (one that cloned with 'hg share' instead of 'hg clone' command). That means the history had been never cloned. You can check for a file '.hg/sharedpath'. If this file exists then actual repo is located elsewhere.
I'd suggest when you'll back online, make another clone of your repository.

Related

Is it ok to delete .hg/store/data/{corrupted-file}.i. from remote mercurial repository

We are unable to pull or push due to integrity error on a file. one possible solution is to reclone it but this means, all developers and teamcity have to re-clone this repository.
Can I not just delete that file from repository directly.
I would simply rename the file (so you are able to restore it).
Afterwards I would do simply:
hg update
hg commit

Mercurial and BitBucket, "abort: repository default-push not found!" error message

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/

how do i setup a local working directory to work with a local repo using Mercurial

Following is the scenario: I have a remote Mercurial repository at ssh://remotehost//dir/repo and I am able to clone it to a local host "pandora" in directory /home/user/localrepo/.
Now, I have a superset of this remote repository, where I add my own testing framework, but do not want to merge to the main depot until I am certain it works. So I clone this "local" repo to /home/user/workingdir/ but when I issue the command to do so
$ hg clone /home/user/localrepo/
only the repository folder gets copied none of the files get copied.
I'm not sure what you mean when you say that "only the repo folders gets copied". So there's two things you can try :
Try to do a hg update in your new clone.
List the directory in /home/user/workingdir and if there is a directory name localrepo in it, this is actually your repository. To clone in the current directory, you must do hg clone /home/user/localrepo .
This sounds odd but try a few things:
First in the local repo that you cloned from do a
hg status -A
are all the files that you think should be in there in there? If not are you at the tip of the repo.
You can see what revision you are at with
hg parent
If you want to just go to the tip do hg update
If there still aren't any files listed in the repo do the same to check the one on the server.
If there aren't any files on the server you will need to add all of the files you want mercurial to track, mercurial doesn't automagically start tracking files in the repo location.
(Use hg add --all to add all of the file in the entire directory tree under the repo location.)
If there are files in the local repo, check the testing area and make sure that it is on the proper changeset.

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)

Mercurial clone issue

I'm using Mercurial and I've cloned a repo locally and upon hg push, I'm getting this:
abort: cannot lock static-http repository
What does this mean? Why can't it lock the static-http repository? Permission issue on the folder?
You can't because Mercurial doesn't implement push for static-http, you need either the smart protocol, ssh or local access.
See here for more details.