Commits

Brodie Rao  committed 72a4f5a

gexport: support exporting the entire hg repo from scratch

This makes it possible to take an existing Hg repository and make a
Git repo out of it.

  • Participants
  • Parent commits ed4cbf8
  • Branches feature/reverse-hg-git

Comments (0)

Files changed (1)

File hggit/git_handler.py

     def export_git_objects(self):
         self.init_if_missing()
 
+        # Import the entire repository if we're creating the Git repo
+        # for the first time.
         nodes = [self.repo.lookup(n) for n in self.repo]
-        export = [node for node in nodes if not hex(node) in self._map_hg]
+        if self._map_hg:
+            export = [node for node in nodes if hex(node) not in self._map_hg]
+        else:
+            export = nodes
+
         total = len(export)
         if total:
             self.ui.status(_("exporting hg objects to git\n"))