return (committer, int(date), tz)
def rev_to_mark(rev):
- global marks
return marks.from_rev(rev)
def mark_to_rev(mark):
- global marks
return marks.to_rev(mark)
def fixup_user(user):
return modified, removed
def export_files(tree, files):
- global marks, filenodes
-
final = []
for path, fid in files.iteritems():
kind = tree.kind(fid)
return final
def export_branch(repo, name):
- global prefix
-
ref = '%s/heads/%s' % (prefix, name)
tip = marks.get_tip(name)
marks.set_tip(name, revid)
def export_tag(repo, name):
- global tags, prefix
-
ref = '%s/tags/%s' % (prefix, name)
print "reset %s" % ref
print "from :%u" % rev_to_mark(tags[name])
print
def do_import(parser):
- global dirname
-
repo = parser.repo
path = os.path.join(dirname, 'marks-git')
sys.stdout.flush()
def parse_blob(parser):
- global blob_marks
-
parser.next()
mark = parser.get_mark()
parser.next()
class CustomTree():
def __init__(self, branch, revid, parents, files):
- global files_cache
-
self.updates = {}
self.branch = branch
return string
def parse_commit(parser):
- global marks, blob_marks, parsed_refs
- global mode
-
parents = []
ref = parser[1]
marks.new_mark(revid, commit_mark)
def parse_reset(parser):
- global parsed_refs
-
ref = parser[1]
parser.next()
parsed_refs[ref] = mark_to_rev(from_mark)
def do_export(parser):
- global parsed_refs, dirname
-
parser.next()
for line in parser.each_block('done'):
print
def do_capabilities(parser):
- global dirname
-
print "import"
print "export"
print "refspec refs/heads/*:%s/heads/*" % prefix
return not True in [c in name for c in '~^: \\']
def do_list(parser):
- global tags
-
master_branch = None
for name in branches:
return remote_branch.sprout(bdir, repository=repo)
def get_remote_branch(name):
- global dirname, branches
-
remote_branch = bzrlib.branch.Branch.open(branches[name])
if isinstance(remote_branch.user_transport, bzrlib.transport.local.LocalTransport):
return remote_branch
yield name, branch.base
def get_repo(url, alias):
- global dirname, peer, branches
-
normal_url = bzrlib.urlutils.normalize_url(url)
origin = bzrlib.bzrdir.BzrDir.open(url)
is_local = isinstance(origin.transport, bzrlib.transport.local.LocalTransport)
return sys.stdin.read(size)
def get_author(self):
- global bad_mail
-
ex = None
m = RAW_AUTHOR_RE.match(self.line)
if not m:
return os.path.relpath(path, '/')
def export_files(files):
- global marks, filenodes
-
final = []
for f in files:
fid = node.hex(f.filenode())
return (name, mail)
def fixup_user(user):
- global mode, bad_mail
-
if mode == 'git':
name, mail = fixup_user_git(user)
else:
bookmarks.write(repo)
def get_repo(url, alias):
- global dirname, peer
+ global peer
myui = ui.ui()
myui.setconfig('ui', 'interactive', 'off')
return repo
def rev_to_mark(rev):
- global marks
return marks.from_rev(rev.hex())
def mark_to_rev(mark):
- global marks
return marks.to_rev(mark)
def export_ref(repo, name, kind, head):
- global prefix, marks, mode
-
ename = '%s/%s' % (kind, name)
try:
tip = marks.get_tip(ename)
export_ref(repo, branch, 'branches', head)
def export_head(repo):
- global g_head
export_ref(repo, g_head[0], 'bookmarks', g_head[1])
def do_capabilities(parser):
- global prefix, dirname
-
print "import"
print "export"
print "refspec refs/heads/branches/*:%s/branches/*" % prefix
return branches[branch][-1]
def get_branch_tip(repo, branch):
- global branches
-
heads = branches.get(hgref(branch), None)
if not heads:
return None
return heads[0]
def list_head(repo, cur):
- global g_head, bmarks, fake_bmark
+ global g_head, fake_bmark
if 'default' not in branches:
# empty repo
g_head = (head, node)
def do_list(parser):
- global branches, bmarks, track_branches
-
repo = parser.repo
for bmark, node in bookmarks.listbookmarks(repo).iteritems():
bmarks[bmark] = repo[node]
print 'done'
def parse_blob(parser):
- global blob_marks
-
parser.next()
mark = parser.get_mark()
parser.next()
files[e] = f
def parse_commit(parser):
- global marks, blob_marks, parsed_refs
- global mode
-
from_mark = merge_mark = None
ref = parser[1]
marks.new_mark(node, commit_mark)
def parse_reset(parser):
- global parsed_refs
-
ref = parser[1]
parser.next()
# ugh
return tip in heads
def do_export(parser):
- global parsed_refs, bmarks, peer
-
p_bmarks = []
p_revs = {}