comparison util.py @ 154:6fa97cfbf62f

fetch: Refactor extra creation to be shared by real and diff replay. Add convert-compatible meta information to extra.
author Augie Fackler <durin42@gmail.com>
date Tue, 23 Dec 2008 11:10:32 -0600
parents 1fde85a10f9e
children 463998d266e3
comparison
equal deleted inserted replaced
153:46f6b872c988 154:6fa97cfbf62f
97 assert len(sourcerev) == 1 97 assert len(sourcerev) == 1
98 sourcerev = sourcerev[0] 98 sourcerev = sourcerev[0]
99 if sourcerev.node() != node.nullid: 99 if sourcerev.node() != node.nullid:
100 return outgoing_rev_hashes 100 return outgoing_rev_hashes
101 101
102 def build_extra(revnum, branch, uuid, subdir):
103 # TODO this needs to be fixed with the new revmap
104 extra = {}
105 branchpath = 'trunk'
106 if branch:
107 extra['branch'] = branch
108 branchpath = 'branches/%s' % branch
109 if subdir and subdir[-1] == '/':
110 subdir = subdir[:-1]
111 if subdir and subdir[0] != '/':
112 subdir = '/' + subdir
113 extra['convert_revision'] = 'svn:%(uuid)s%(path)s@%(rev)s' % {
114 'uuid': uuid,
115 'path': '%s/%s' % (subdir , branchpath),
116 'rev': revnum,
117 }
118 return extra
119
102 120
103 def is_svn_repo(repo): 121 def is_svn_repo(repo):
104 return os.path.exists(os.path.join(repo.path, 'svn')) 122 return os.path.exists(os.path.join(repo.path, 'svn'))