hg-git | git bridge , pushed to directly from the hg-git plugin | Plugin library

 by   schacon Python Version: Current License: GPL-2.0

kandi X-RAY | hg-git Summary

kandi X-RAY | hg-git Summary

hg-git is a Python library typically used in Plugin applications. hg-git has no bugs, it has no vulnerabilities, it has build file available, it has a Strong Copyleft License and it has low support. You can download it from GitHub.

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

            kandi-support Support

              hg-git has a low active ecosystem.
              It has 618 star(s) with 76 fork(s). There are 34 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 50 open issues and 258 have been closed. On average issues are closed in 619 days. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of hg-git is current.

            kandi-Quality Quality

              hg-git has 0 bugs and 0 code smells.

            kandi-Security Security

              hg-git has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              hg-git code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              hg-git is licensed under the GPL-2.0 License. This license is Strong Copyleft.
              Strong Copyleft licenses enforce sharing, and you can use them when creating open source projects.

            kandi-Reuse Reuse

              hg-git releases are not available. You will need to build from source code and install.
              Build file is available. You can build the component from source.
              Installation instructions are not available. Examples and code snippets are available.
              It has 4076 lines of code, 319 functions and 20 files.
              It has high code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed hg-git and discovered the below as its top functions. This is intended to give you an instant insight into hg-git implemented functionality, and help decide if they suit your requirements.
            • 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
            Get all kandi verified functions for this library.

            hg-git Key Features

            No Key Features are available at this moment for hg-git.

            hg-git Examples and Code Snippets

            No Code Snippets are available at this moment for hg-git.

            Community Discussions

            QUESTION

            How to clone topics in mercurial?
            Asked 2022-Mar-06 at 07:45
            Background: Mercurial Topics

            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:45

            It seems like this was a localized bug. Making the source repo publishing seems to be enough.

            Source https://stackoverflow.com/questions/70868931

            QUESTION

            Interoperability of Mercurial 6 with other VCSes
            Asked 2022-Mar-04 at 18:12

            Some years ago, Mercurial | TortoiseHG could exchange data bidirectionally easy with at least 2 Big Brothers:

            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 my TortoiseHg\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:12

            So, 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:

            Source https://stackoverflow.com/questions/70490564

            QUESTION

            What parts of the hg-git metadata state do I need to back up in order to start over?
            Asked 2022-Jan-26 at 15:30

            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:30

            The 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:

            1. Clone or initialise the Mercurial repository, somehow.
            2. Clone or initialise the embedded Git repository, e.g. using git clone --bare git+ssh://username@server.tld/project/repo.git .hg/git.
            3. Copy over the metadata from the original repository, and put it into .hg/git-mapfile.
            4. Run hg git-cleanup to remove any commits from the map no longer known to Mercurial.
            5. Pull from Git.
            6. 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.

            Source https://stackoverflow.com/questions/70817545

            QUESTION

            How to check if the installed Mercurial (hg) is using Python2 or Python3?
            Asked 2020-Dec-09 at 15:25

            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:25

            I 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:

            Source https://stackoverflow.com/questions/65213113

            QUESTION

            HG-Git: AttributeError: 'bytes' object has no attribute 'encode'
            Asked 2020-Jun-15 at 11:45

            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:30

            QUESTION

            Edit commits in HG repo & mark as "closed"
            Asked 2020-Jan-14 at 10:19

            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:19

            I 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.

            Source https://stackoverflow.com/questions/59710402

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install hg-git

            You can download it from GitHub.
            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

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/schacon/hg-git.git

          • CLI

            gh repo clone schacon/hg-git

          • sshUrl

            git@github.com:schacon/hg-git.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link