I'm trying to convert a CVS repository to mercurial but can't get it to work.
I start with a clean checkout:
cvs -d :sspi;username=xxx;hostname=yyy.local:/cvsrepos checkout repo
Which works fine
I then do:
hg convert .
But it fails with:
assuming destination .-hg
initializing destination .-hg repository
connecting to :sspi;username=xxx;hostname=yyy.local:/cvsrepos
abort: unexpected response from CVS server (expected "Valid-requests", but got 'E cvs [server aborted]: Root :sspi;username=xxx;hostname=yyy.local:/cvsrepos must be an absolute pathname\n')
I'm running cvsnt on windows 7
Edit:
Investigated this a bit more and it seems like mercurial starts a local server cvs server and then communicates with that instance instead of the remote server.
I base this on the following observations:
I created a cvs.bat file that sends the command line arguments to a file. The file shows the argument "server".
process monitor shows that hg.exe tries to open the file
C:\cvstest\:sspi;username=xxx;hostname=yyy.local:\cvsrepos which of course fails.
Can it be that hg does not understand the sspi connection string?
Edit 2:
Not a solution but I found a workaround: Copy the complete remote repository to my machine and:
cvs -d :local:\localcopyofrepo checkout repo
hg convert repo
Everything worked fine
Looks like the error message is telling you to use an absolute pathname to the repository, try using
hg convert <full_path_including_drive>
rather than the . path on a checked out sandbox of your CVS repository. You could also try specifying the repository type in the convert command by adding -s cvs to the command, the result would look something like this:
hg convert -s cvs C:\sandbox\cvsrepos
It looks like you are using ConvertExtension. Can you try hg convert from the parent folder and specify the folder name, instead of . and see if it works?
Related
For example I have a hg versioned project in this path: C:\src\sample_project
Now, lets this project have subfolders, and lets say I'm editing a file inside this project C:\src\sample_project\docs\index.rst.
Having the path of this file C:\src\sample_project\docs\index.rst what is the easiest and most effective way to check if the file is versioned by hg, by either using Windows shell commands, hg.exe or tortoise (thg.exe)?
I'll post my doubt as answer.
Command to check if file is versioned: hg status <path> and then if the first character in stdout of this command is ? or a (from abort: no repository found in...) I should assume that file is not versioned.
What you stated is a way, but there is a cleaner one imo. You can use:
hg status -u which lists all unknown (read: not tracked) files in your repository.
all,
I have searched for this problem for long time and tried different methods.
I want to maintain my code on the server through only SSH. But when I run this:
sudo hg clone -v ssh://carl#hostname//home/carl/Java/Projects/peta/
Mercurial keeps telling me remote: abort: There is no Mercurial repository here (.hg not found)!. Some articles said that the path should be correct and there should be a .hg directory there. But I have checked it for several times and I am sure there is a .hg folder at the right place.
I also tried
hg --config ui.remotecmd=/usr/bin/hg clone ssh://carl#hostname//home/carl/Java/Projects/peta/
But it failed as well. What other problem it could be? Thanks.
Solved
I finally fix the problem. Previously, I create a repository on my local machine, and scp all files (including .hg) on to the server. I try to remove .hg directory first, and create a repo on the server through ssh (hg init). Then hg clone works!
Extraction from hg help urls
Some notes about using SSH with Mercurial:
SSH requires an accessible shell account on the destination machine and
a copy of hg in the remote path or specified with as remotecmd.
path is relative to the remote user's home directory by default. Use an
extra slash at the start of a path to specify an absolute path:
ssh://example.com//tmp/repository
this means, at least, that you can't use the same URI and change only one/two slash it it: at least one path will be non-existent.
Consequence of the quote and error message: you must to debug (with any ssh-tool) and find correct path to needed directory. you can:
use scp (f.e) and copy known file from known location
SSH into remote host in interactive session and verify path (both?) by hand, i.e: ssh ..., cd ..., pwd, verify output of pwd
... any other debugger
When you'll get good path after login, you have to check next point of failure - .hg dir permissions
After verification of these checkpoints you'll get clone and some bonus in the form of understanding "What happened before"
HTH
I don't know if this really helps but, according to the FAQ:
hg clone ssh://USER#REMOTE/path/to/repo
They are using only one / after the USER#HOST. Maybe you can try that way.
César Bustíos's answer is almost correct, but that tries to clone from remote to local. To opposite way, we have to add the local path. In the case it is the current directory, it will be a dot.
hg clone . ssh://USER#REMOTE/path/to/repo
Hope it helps. :)
Running on Debian, to solve my problem, I have added the following line to my /var/lib/mercurial-server/.mercurial-server configuration file after the [paths]
[paths]
/ = ~/repos
...
And don't forget to issue this command afterwards: sudo -u hg /usr/share/mercurial-server/refresh-auth
I have been trying to use HG convert to migrate a local CVS repository to HG. When I run the command...
hg convert CATools
I see the following message:
"Valid-requests", but got '')
"Valid-requests", but got '')> assuming destination CATools-hg
initializing destination CATools-hg
repository connecting to
:sspi:shcgl-egcrizan:2401:/cvsroot
Unknown command: `server'
CVS commands are:
add Add a new file/directory to the repository
admin Administration front end for rcs
annotate Show last revision where each line was modified
checkout Checkout sources for editing
commit Check files into the repository
diff Show differences between revisions
edit Get ready to edit a watched file
editors See who is editing a watched file
export Export sources from CVS, similar to checkout
history Show repository access history
import Import sources into CVS, using vendor branches
init Create a CVS repository if it doesn't exist
log Print out history information for files
login Prompt for password for authenticating server
logout Removes entry in .cvspass for remote repository
rannotate Show last revision where each line of module was
modified
rdiff Create 'patch' format diffs between releases
release Indicate that a Module is no longer in use
remove Remove an entry from the repository
rlog Print out history information for a module
rtag Add a symbolic tag to a module
status Display status information on checked out files
tag Add a symbolic tag to checked out version of files
unedit Undo an edit command
update Bring work tree in sync with repository
version Show current CVS version(s)
watch Set watches
watchers See who is watching a file (Specify the --help
option for a list of other help
options) abort: unexpected response
from CVS server (expected
"Valid-requests", but got '')"Valid-requests", but got '')
Has anybody found a workaround? I found this article but do not understand how to do this on Windows.
http://blog.edsantiago.com/archives/2009/02/19/#e2009-02-19T19_23_32.txt
Please consider using cvs2hg for the conversion. "hg convert" is known to have problems with nontrivial CVS repositories, for example often silently producing a Mercurial repository whose branch/tag contents do not agree with those in the CVS repository. Unless you require incremental conversion (and can live with inaccuracies), "hg convert" is not a reliable solution for converting from CVS to Mercurial.
How "local" is local? If you have filesystem access to the CVS repository, you can just copy it over and do a real local hg convert.
I'm having difficulty figuring out how to clone my Mercurial repository from my local machine to the server. I actually found an answer to my question here (As the second part of #4.5 in https://www.mercurial-scm.org/wiki/FAQ), but I don't know what to do with the answer.
On the other hand, if the error
message is remote: bash: line 1: hg:
command not found, the problem is that
the environment used by ssh does not
have hg in its PATH. There are two
ways to deal with this problem:
In your ~/.hgrc file, set a remotecmd
value in the [ui] section giving the
exact path to hg. On the server,
create a ~/.ssh/environment file that
defines an appropriate PATH, and add
PermitUserEnvironment yes to
/etc/sshd_config.
I would like a clearer explanation of how to solve this problem BOTH ways. How does one find out the exact path of their Mercurial installation? What is an "appropriate PATH" to use on the server?
How does one find out the exact path of their Mercurial installation?
Log on to the server and run command -v hg. The response is the full path to hg that would be run given your current environment. Now that you know the full path, you can easily use the remotecmd option in your ~/.hgrc.
What is an "appropriate PATH" to use on the server?
The most basic PATH that a user should have is /usr/bin:/bin (although /usr/local/bin:/usr/bin:/bin is also common). The appropriate PATH for your situation is whatever your current $PATH is plus the directory that contains the hg binary, as determined above -- /usr/bin:/bin:/path/to/hg/dir.
I have a mercurial repository, and inside it a file that ends with '>>'. When doing a hg clone from this windows repository, I get the following error:
abort: The filename, directory name, or volume label syntax is incorrect: C:\Users\Path\To\Repos/More/Path/file>>
Is there a way to fix it? It seems to do with the '>>' being confused for a redirect, although I'm also unsure of why it switched from using \ to /.
The problem is that on Windows, a filename can't contain the > symbol. You should probably try and find the push to the repository that added the file in question and do a partial rollback to get rid of that file. Then, never name a file that way again :)
EDIT: You might try performing a pull from a Linux machine or VM if you have it, and then renaming the file without the weird characters, then commit and push back to the repository. I'm not sure if you tried that already.