diff options
author | Felipe Contreras <felipe.contreras@gmail.com> | 2013-08-28 14:23:12 -0500 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-08-29 11:40:57 -0700 |
commit | 641a2b5bee4c759c4dd36b5ad9e7f159aca54611 (patch) | |
tree | 2ba41495de2708949661839614f1f28ce2b5c913 /contrib/remote-helpers/git-remote-bzr | |
parent | remote-helpers: trivial style fixes (diff) | |
download | tgif-641a2b5bee4c759c4dd36b5ad9e7f159aca54611.tar.xz |
remote-helpers: cleanup more global variables
They don't need to be specified if they are not going to be set.
Suggested-by: Dusty Phillips <dusty@linux.ca>
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib/remote-helpers/git-remote-bzr')
-rwxr-xr-x | contrib/remote-helpers/git-remote-bzr | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/contrib/remote-helpers/git-remote-bzr b/contrib/remote-helpers/git-remote-bzr index e4fdfb0a19..42cec58a00 100755 --- a/contrib/remote-helpers/git-remote-bzr +++ b/contrib/remote-helpers/git-remote-bzr @@ -178,11 +178,9 @@ class Parser: 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): @@ -237,8 +235,6 @@ def get_filechanges(cur, prev): return modified, removed def export_files(tree, files): - global marks, filenodes - final = [] for path, fid in files.iteritems(): kind = tree.kind(fid) @@ -280,8 +276,6 @@ def export_files(tree, files): return final def export_branch(repo, name): - global prefix - ref = '%s/heads/%s' % (prefix, name) tip = marks.get_tip(name) @@ -382,16 +376,12 @@ def export_branch(repo, 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') @@ -417,8 +407,6 @@ def do_import(parser): sys.stdout.flush() def parse_blob(parser): - global blob_marks - parser.next() mark = parser.get_mark() parser.next() @@ -429,8 +417,6 @@ def parse_blob(parser): class CustomTree(): def __init__(self, branch, revid, parents, files): - global files_cache - self.updates = {} self.branch = branch @@ -587,9 +573,6 @@ def c_style_unescape(string): return string def parse_commit(parser): - global marks, blob_marks, parsed_refs - global mode - parents = [] ref = parser[1] @@ -661,8 +644,6 @@ def parse_commit(parser): marks.new_mark(revid, commit_mark) def parse_reset(parser): - global parsed_refs - ref = parser[1] parser.next() @@ -678,8 +659,6 @@ def parse_reset(parser): 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'): @@ -728,8 +707,6 @@ def do_export(parser): print def do_capabilities(parser): - global dirname - print "import" print "export" print "refspec refs/heads/*:%s/heads/*" % prefix @@ -747,8 +724,6 @@ def ref_is_valid(name): return not True in [c in name for c in '~^: \\'] def do_list(parser): - global tags - master_branch = None for name in branches: @@ -782,8 +757,6 @@ def clone(path, remote_branch): 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 @@ -825,8 +798,6 @@ def find_branches(repo): 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) |