I have a problem with hg convert. When I write in the command line "hg convert f:/test" it gives me this: abort: invalid mode ('r') or filename. What I doing wrong?
You have to provide more details:
Version of Mercurial
Source repository type
and, maybe, use full command line (destination, filemap-file, source-type)
Add-on
According to topic Converting: abort: invalid mode ('r') or filename it was bug in 2.1.1, fixed in 1-st April 2012 release
Related
When I click on Annotate, I often get this message in PyCharm 2018.2.5 (running on Ubuntu 18.04):
Number of lines annotated by Mercurial is not equal to number of lines
in the file. Check file econding and line separators
It looks like a Mercurial error, but in command line, the following command on the same file is succesful:
# hg annotate -ud <file>
Line enconding is LF, File encoding is UTF-8
EDIT
Mercurial version:
# hg --version
Mercurial Distributed SCM (version 4.5.3)
The file I'm try to annotate is in a subrepository, and checking the logs I discovered
PyCharm is trying to annotate using the father's repo.
If I execute the command in father's directory, I get an empty result.
So the error is misleading, and apparently I don't know how to set up PyCharm in this case.
Is there a way to fix this?
I got it. I think it makes sense answering my own question.
The structure of my project is the following:
Project root (no VCS)
RepoDir (hg repository)
SubRepoDir (hg subrepository)
In this configuration something confuses PyCharm, and subrepositories at third level
won't be recognized.
The following works pretty well:
RepoDir as Project root (hg repository)
SubRepoDir (hg subrepository)
If other directories are needed, one can add them as content root.
I'm trying to get Mercurial to show me all changesets in phase secret. According to the docs, I should execute the command hg log -r "secret()", but if I do that, it tells me hg: parse error at 9: invalid token. I'm running Mercurial 2.8
Is it possible to find the changesets I'm looking for?
The solution turned out to be that I copied the command from somewhere, but that somewhere used quote characters that my command line didn't recognize.
How do you make the mercurial "diff" command produce output that is compatible with the unix or unxutil patch command?
I need to create a patch file that I can send to a coworker who doesn't have Mercurial installed.
I've tried using hg diff -r 3:5 > patch1.diff and I get an error from the patch command when applying it. (hold on, I will post the error message as soon as I have a chance....)
OK, here is a test case that I've uploaded to bitbucket:
hg clone https://bitbucket.org/jason_s/test-patch-apply P2base
hg update -r 2 -R P2base
hg diff -r 2:4 -R P2base > p2base.patch
rm -r P2base/.hg
cd P2base
patch < ../p2base.patch
I get this on my Windows PC:
C:\tmp\hg\P2base>patch < ../p2base.patch
patching file bar.txt
Assertion failed: hunk, file ../patch-2.5.9-src/patch.c, line 354
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
Never mind, this is a documented problem (with a REALLY POOR ERROR MESSAGE) that can be overcome. From http://gnuwin32.sourceforge.net/packages/patch.htm :
On MS-Windows, the patchfile must be a text file, i.e. CR-LF must be
used as line endings. A file with LF may give the error: "Assertion
failed, hunk, file patch.c, line 343," unless the option '--binary' is
given.
I used --binary and it worked fine.
If I run:
hg convert /path/to/repo
I get the error:
abort: invalid mode ('r') or filename
I've checked and I think the error is a Python error, but it doesn't help me resolve the errror.
Is there any way to get more information and, ultimate fix?
Bug, introduced in 2.1.1
Downgrade to 2.1 or wait April release: patch already committed.
We are migrating to Mercurial, and of course, we need to update our CruiseControl.Net build process to use it instead of Visual SourceSafe.
We updated our CruiseControl config file with the following block:
<sourcecontrol type="hg" autoGetSource="true">
<executable>C:\Program Files\Mercurial\hg.exe</executable>
<repo>https://bitbucket.org/GTSDevs/galaxy</repo>
<workingDirectory>C:\Cruise Control\Releases\5.0.0\source</workingDirectory>
<branch>master</branch>
<multipleHeadsFail>false</multipleHeadsFail>
<tagOnSuccess>true</tagOnSuccess>
<timeout units="minutes">20</timeout>
</sourcecontrol>
This worked well until we pushed some code to our repository with a branch in it. Now our build fails with the following error:
ThoughtWorks.CruiseControl.Core.CruiseControlException: Source control operation failed: abort: crosses branches (merge branches or use --clean to discard changes)
. Process command: C:\Program Files\TortoiseHg\hg.exe update -r master --noninteractive
at ThoughtWorks.CruiseControl.Core.Sourcecontrol.ProcessSourceControl.Execute(ProcessInfo processInfo)
at ThoughtWorks.CruiseControl.Core.Sourcecontrol.Mercurial.Mercurial.GetSource(IIntegrationResult result)
at ThoughtWorks.CruiseControl.Core.IntegrationRunner.Build(IIntegrationResult result)
at ThoughtWorks.CruiseControl.Core.IntegrationRunner.Integrate(IntegrationRequest request)
All the information I can find on the error appears to pertain to doing an update.
Can anyone help out with getting past this?
Is there something more we should be doing in our ccnet.config file to support Mercurial?
Some ideas:
the best way would be to add a new parameter to the Mercurial source control block in order to add the --clean command line parameter
mercurial support in CruiseControl.NET - how to clean & update build folder?