Ph0en1x
Ph0en1x

Reputation: 10087

compare sources from git and mercurial repositories and synchronize them

In our project due to the way of team operating and corporate security policy the same codebase hosted inside 2 repositories, one is git, 2nd is mercurial and one part of the team normally committing to mercurial repo, 2nd part commit to git.

Because of such a strange way of operating with some time codebase in 2 repos stop being synchronized, and I need to make it sync again.

So initially I have 2 questions:

  1. How to compare sources from Git and Mercurial
  2. How to synchronize them.

UPD1: In case of synchronization, I don't think it's need to be super advanced, e.g. have the same commit's history or something like that. If it's just will put files in the same state (where possible, manual merging in other case) - that's will be more than completely fine.

Upvotes: 1

Views: 45

Answers (1)

gturri
gturri

Reputation: 14629

To compare the sources, you could clone the mercurial and the git repo in your computer, and use diff on those directories. For example:

diff -rq git_repo hg_repo | grep -v .git | grep -v .hg

The synchronisation part is harder: it depends on what you want to do in cases where the code diverged between the two. I guess you can do it manually using the list of diffs generated previously, but I can't think of a more automated way.

Upvotes: 1

Related Questions