comparison hggit/git2hg.py @ 1115:8ed6c0cae9b8

cleanup: add some blank lines
author Sean Farley <sean@farley.io>
date Mon, 27 Nov 2017 18:46:07 -0500
parents f1c4e2ba8ff9
children bd1a01f98154
comparison
equal deleted inserted replaced
1114:6ef251fdbb30 1115:8ed6c0cae9b8
1 # git2hg.py - convert Git repositories and commits to Mercurial ones 1 # git2hg.py - convert Git repositories and commits to Mercurial ones
2 2
3 import urllib 3 import urllib
4 from dulwich.objects import Commit, Tag 4 from dulwich.objects import Commit, Tag
5
5 6
6 def find_incoming(git_object_store, git_map, refs): 7 def find_incoming(git_object_store, git_map, refs):
7 '''find what commits need to be imported 8 '''find what commits need to be imported
8 9
9 git_object_store is a dulwich object store. 10 git_object_store is a dulwich object store.
71 todo = get_heads(refs) 72 todo = get_heads(refs)
72 commits = get_unseen_commits(todo) 73 commits = get_unseen_commits(todo)
73 74
74 return GitIncomingResult(commits, commit_cache) 75 return GitIncomingResult(commits, commit_cache)
75 76
77
76 class GitIncomingResult(object): 78 class GitIncomingResult(object):
77 '''struct to store result from find_incoming''' 79 '''struct to store result from find_incoming'''
78 def __init__(self, commits, commit_cache): 80 def __init__(self, commits, commit_cache):
79 self.commits = commits 81 self.commits = commits
80 self.commit_cache = commit_cache 82 self.commit_cache = commit_cache
83
81 84
82 def extract_hg_metadata(message, git_extra): 85 def extract_hg_metadata(message, git_extra):
83 split = message.split("\n--HG--\n", 1) 86 split = message.split("\n--HG--\n", 1)
84 # Renames are explicitly stored in Mercurial but inferred in Git. For 87 # Renames are explicitly stored in Mercurial but inferred in Git. For
85 # commits that originated in Git we'd like to optionally infer rename 88 # commits that originated in Git we'd like to optionally infer rename