hg-git | git bridge , pushed to directly from the hg-git plugin | Plugin library
kandi X-RAY | hg-git Summary
kandi X-RAY | hg-git Summary
This is the Hg-Git plugin for Mercurial, adding the ability to push and pull to/from a Git server repository from Hg. This means you can collaborate on Git based projects from Hg, or use a Git server as a collaboration point for a team with developers using both Git and Hg. The Hg-Git plugin can convert commits/changesets losslessly from one system to another, so you can push via an Hg repository and another Hg client can pull it and their changeset node ids will be identical - Mercurial data does not get lost in translation. It is intended that Hg users may wish to use this to collaborate even if no Git users are involved in the project, and it may even provide some advantages if you’re using Bookmarks (see below).
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Perform a pull operation
- URL of the resource
- Setup git repository
- Generate a subclass of git repository
- Wrapper for git uri
- Checks if the given uri is a git ssh - ssh remote URL
- Wrap the http scheme
- Verify a git repository
- Verify a git commit against a git commit
- Saves the gitmap file
- Get a function to be used for profiling
- Return a local repository based on path
- Return True if path is a git directory
- Return True if the given path is a local file
- Get the version of a file
- Calculate the load map for the given repo
- Determine if a given path is a git repository
hg-git Key Features
hg-git Examples and Code Snippets
Community Discussions
Trending Discussions on hg-git
QUESTION
Mercurial has a nice feature call topics
as part of the evolve
extension. These act as temporary lightweight local branches, and are an integral part of the Heptapod workflow, ensuring nice interactions with Git (via hg-git
) for example. They are enabled by include the following in your ~/.hgrc
file (or per-repo in .hg/hgrc
):
ANSWER
Answered 2022-Mar-06 at 07:45It seems like this was a localized bug. Making the source repo publishing seems to be enough.
QUESTION
Some years ago, Mercurial | TortoiseHG could exchange data bidirectionally easy with at least 2 Big Brothers:
- Subversion, using HGSubversion
- Git, using HG-Git
Current (6.0 versions of family) state - the ordinary users have none:
- hg-subversion is broken (extension can't be loaded), bundled with THG (Mercurial ???) extension not updated since 2019
hgsubversion: 6a6ce9d9da35 2019-04-19
(extraction from myTortoiseHg\extension-versions.txt
), external SVN-bindings exist only for Python 2.7 (while py3-movement inside Mercurial is live and active) - hg-git got some big troubles, starting from THG 4.9 (manual patching of library.zip was required), on 6 version the situation has gotten better (no patching), but still unsatisfactory for the common user - installing Python 2.7 (for single-user) and using
pip
isn't The Right Way (tm)
Are there any comments, additions, clarifications, recommendations on how to do it (if what I am doing is wrong)?
Addition after some testing: special verson tortoisehg-6.0hggit-x64.msi from Matt Harbison at least allow using hg-git with ssh-transport (not http yet) and can be recommended for every-day usage by ordinary user.
...ANSWER
Answered 2022-Mar-04 at 18:12So, as a current maintainer of hg-git and former contributor to hgsubversion, I think I can provide some context here.
Regarding hgsubversion, the short answer that it is either dead or — at best — extremely dormant. Personally, I have not interacted with a Subversion repository in years, and that's a common experience. No-one has been sufficiently motivated to fix bugs, keep it working, and — last, but not least — make it work with Python 3.
For hg-git, a period of semi-dormant state meant that the TortoiseHg maintainers stopped bundling it. We now keep up with Mercurial releases, and I've requested that they reverse that decision. I believe they bundle Dulwich, but as I don't use Windows, I can't say for sure. That said, it's quite reasonable to want to use hg-git with TortoiseHg, and if you run into any specific issues, I'd suggest you file a bug with them — or perhaps add a comment to the bug I linked earlier.
Generally speaking, you should be able to use 0.10.x version of hg-git with most versions of TortoiseHg, as I believe they bundle Dulwich. In that case, enabling the extension should be as simple as:
QUESTION
This is currently a purely theoretical question (related to this one), but let me first give the background. Whenever you run hg gexport
the initial hash will vary from invocation to invocation. This is similar to when you run git init
or hg init
. However, since the Mercurial and Git commits correspond to each other and build on previous hashes, there should be some way to start over from a minimal common initial state (or minimal state on the Git side, for example).
Suppose I have used hg-git in the past and now I am trying to sync again between my Mercurial and my Git states, but without (or very little of) the original .git
directory from the hg gexport
. What I do have, though, are the two metadata files: git-mapfile
and git-tags
.
There is an old Git mirror, which is sort of "behind" and the Mercurial repo which is up-to-date.
Then I configure the Mercurial repo for hg-git like so (.hg/hgrc
):
ANSWER
Answered 2022-Jan-26 at 15:30The core metadata is stored in .hg/git-mapfile
, and the actual Git repository is stored in .hg/git
or .git
dependending on intree
. The git-mapfile
is the only file needed to reproduce the full state; anything else is just cache. In order to recreate a repository from scratch, do the following:
- Clone or initialise the Mercurial repository, somehow.
- Clone or initialise the embedded Git repository, e.g. using
git clone --bare git+ssh://username@server.tld/project/repo.git .hg/git
. - Copy over the metadata from the original repository, and put it into
.hg/git-mapfile
. - Run
hg git-cleanup
to remove any commits from the map no longer known to Mercurial. - Pull from Git.
- Push to Git.
These are the steps I'd use, off the top of my head. The three last steps are the most important. In particular, you must pull from Git to populate the repository prior to pushing; otherwise, the conversion will fail.
QUESTION
I wanted to install the hg-git
extension with python pip but I'm not sure if I should use pip
(Python2) or pip3
(Python3).
hg version
gives this:
ANSWER
Answered 2020-Dec-09 at 15:25I am running Ubuntu 20.04 and on my Mercurial version (5.3.1) it is still using Python2, so I guess it should be the same. You can check it with:
QUESTION
I'm trying to clone a git repository with mercurial and hg-git, but an AttributeError keeps coming up. When I run hg clone git://github.com/michaelfm1211/simpleserve
, the output I get is this:
ANSWER
Answered 2020-Jun-11 at 05:30QUESTION
I'm currently dealing with the fallout from BitBucket dropping HG support. We're going to be giving hg-git
a try because, while my preference is self-hosting, my boss isn't quite mad enough at Atlassian to move away from BB yet. Taking this opportunity to clean up our existing HG repo before the conversion to GIT. Have used hg convert
to remove some accidentally committed binaries to reduce size, etc.
One thing I've noticed is that we've got about two dozen old branches that are technically "open", but have been merged into default (no closing commit, but they're months to years old). Is there any way I can use a tool like hg histedit
or during the hg convert
to go back and specifically mark old branch heads with --close-branch
?
Looking through docs I can find things about editing files, editing the contents of commits, or modifying commit messages, but nothing I can find mentions meta-data around whether a commit is "closed". I know this is just a flag on a given commit, but I don't know how to retroactively add it via any HG extension.
Edit: Just to add a bit more clarity, I recognise I can just update to each of these old branches & add a new commit that just closes the branch. There'll be a lot of dangling-looking, closed heads, but that'd work fine enough. However, I also then have to give each of them a bookmark in HG as well, or these additional "closing" commits are lost in the hg-git conversion. I'd rather avoid having to add ~30 additional branches to the git branch-list, just to have them show up as closed properly in HG without having to use revsets.
What I want to do isn't "essential" in the grand-scheme of the repo, but I'd be surprised if editing a commit's metadata to say --close-branch
were impossible.
ANSWER
Answered 2020-Jan-14 at 10:19I tested out the rebase idea with a mock repository and it seemed to work.
Here was the starting repo:
And here was the state after rebase:
I think this example matches what the question was asking about. The original dangling close-branch changeset was moved to precede the merge.
I updated to default and ran the following command:
hg rebase --dest=4 --source=3 --keepbranches --config=ui.merge=internal:merge
I actually used Tortoise Workbench to execute the rebase and that is the command it used. So the final argument for ui.merge
is probably not strictly necessary.
As you may have already noticed using hg convert
its a really good idea to make new clones when you go to modify the repository. Thus if it gets messed up you have an easy undo option. I'd certainly recommend that approach for this operation as well.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install hg-git
You can use hg-git like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page