I am merging my current working directory with another head using mercurial internal merge tool called merge-other and i am getting following error:
/bin/sh: internal:merge-other: command not found
i am running this command :
hg merge --tool=internal:merge-other rev
Related
I have a problem on a repository. I use phabricator as the front-gui of my repository. Recently I found I am not able to open and view a few directories in one repository in phabricator while other directories are fine. Phabricator reports 'hg locate' command output is empty like this:
Command failed with error #1!
COMMAND
hg locate --print0 --rev ''\''d8f8fd40c58bf883ec88bd037f96b962ec16f48e'\''' -I './/OA'
STDOUT
(empty)
STDERR
(empty)
I tried the same command in the repository on the server and I did get no output. So I just simply tried the command 'hg locate' without any parameter. That command is supposed to list all the files in the repo but I found the output was still empty!
I then cloned the repo to another directory on the server and tried the same 'hg locate' command and found it was find and I got the file list in the repo.
What is the problem with my original repo? Is there any setting to prevent the 'hg locate' command to output anything?
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.
Sometimes I can't seem to be able to track the merge conflicts.
I need a command that allows me to discard one of my uncommitted files and then update it with the remote copy.
I tried hg revert myfile followed by hg pull , hg commit
but it still won't let me merge or commit.
It keeps telling me to fix unresolved conflict first.
You might need to let Mercurial know that you have resolved the conflict, using hg resolve. From the man page:
hg resolve [OPTION]... [FILE]...
redo merges or set/view the merge status of files
Merges with unresolved conflicts are often the result of non-interactive
merging using the "internal:merge" configuration setting, or a command-
line merge tool like "diff3". The resolve command is used to manage the
files involved in a merge, after "hg merge" has been run, and before "hg
commit" is run (i.e. the working directory must have two parents). See "hg
help merge-tools" for information on configuring merge tools.
The resolve command can be used in the following ways:
- "hg resolve [--tool TOOL] FILE...": attempt to re-merge the specified
files, discarding any previous merge attempts. Re-merging is not
performed for files already marked as resolved. Use "--all/-a" to select
all unresolved files. "--tool" can be used to specify the merge tool
used for the given files. It overrides the HGMERGE environment variable
and your configuration files. Previous file contents are saved with a
".orig" suffix.
- "hg resolve -m [FILE]": mark a file as having been resolved (e.g. after
having manually fixed-up the files). The default is to mark all
unresolved files.
- "hg resolve -u [FILE]...": mark a file as unresolved. The default is to
mark all resolved files.
- "hg resolve -l": list files which had or still have conflicts. In the
printed list, "U" = unresolved and "R" = resolved.
Note that Mercurial will not let you commit files with unresolved merge
conflicts. You must use "hg resolve -m ..." before you can commit after a
conflicting merge.
Here's how you pick up the version of the file from the server.
When you "hg pull", all changes from the server come into your copy of the repository. You can get the contents of a file in any revision using:
hg cat -r <rev> <file>
Use that to overwrite the local file, and commit.
I've set up TeamCity (v6.5.5 - build 18087) to build an ASP.NET project from Mercurial. Twice in 56 build now I have got the error below, and the only common denominator I can see is that these changesets had files added to them.
If I clear the server's mercurial cache I get rif of the problem until next time, but that's not a great solution.
I've seen posts from people with similar problems, but haven't found a solution from reading them.
Would be thankful if someone can point me in the right direction here.
From TeamCity build log:
[20:54:21]: Patch is broken, can be found in file: C:\BuildAgent\temp\cache\temp547491181020464280patch_64
[20:54:21]: Failed to build patch for build #56 {build id=64}, VCS root: mercurial: http://server:8000 {instance id=1, parent id=2}, due to error: 'cmd /c hg cat -o C:\TeamCity\temp\mercurial9111169551826812670catresult\%p -r 75f205de9192 website\MasterPage.master website\MasterPage.master.designer.cs website\OurProject.csproj website\Login.aspx website\Login.aspx.designer.cs website\apage.aspx website\apage.aspx.designer.cs website\anotherpage.aspx website\anotherpage.aspx.designer.cs website\thirdpage.aspx website\thirdpage.aspx.designer.cs' command failed. stderr: abort: data/website/thirdpage.aspx.i#2b64b5d6eb86: no match found!
jetbrains.buildServer.agent.impl.patch.PatchDownloaderImpl$1: Server was not able to build correct patch, most likely due to VCS errors, will try again. at jetbrains.buildServer.agent.impl.patch.PatchDownloaderImpl.throwError(PatchDownloaderImpl.java:113) at jetbrains.buildServer.agent.impl.patch.PatchDownloaderImpl.checkPatch(PatchDownloaderImpl.java:103) at jetbrains.buildServer.agent.impl.patch.PatchDownloaderImpl.copyPatchAndCheck(PatchDownloaderImpl.java:64)...
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?