comparison hg_delta_editor.py @ 124:291925677a9f

tag_repo: remove gentags command, extend repo.tags(), HgChangeEditor now takes either repo or repo_path
author Luke Opperman <luke@loppear.com>
date Thu, 04 Dec 2008 13:10:40 -0600
parents 58de7aea8a77
children 4d42dbbb5127
comparison
equal deleted inserted replaced
123:58de7aea8a77 124:291925677a9f
56 f.write(str(revnum) + ' ' + node.hex(node_hash) + ' ' + (branch or '') + '\n') 56 f.write(str(revnum) + ' ' + node.hex(node_hash) + ' ' + (branch or '') + '\n')
57 f.flush() 57 f.flush()
58 f.close() 58 f.close()
59 self.revmap[revnum, branch] = node_hash 59 self.revmap[revnum, branch] = node_hash
60 60
61 def __init__(self, path, ui_=None, subdir='', author_host='', 61 def __init__(self, path=None, repo=None, ui_=None,
62 subdir='', author_host='',
62 tag_locations=['tags']): 63 tag_locations=['tags']):
63 """path is the path to the target hg repo. 64 """path is the path to the target hg repo.
64 65
65 subdir is the subdirectory of the edits *on the svn server*. 66 subdir is the subdirectory of the edits *on the svn server*.
66 It is needed for stripping paths off in certain cases. 67 It is needed for stripping paths off in certain cases.
67 """ 68 """
68 if not ui_: 69 if not ui_:
69 ui_ = ui.ui() 70 ui_ = ui.ui()
70 self.ui = ui_ 71 self.ui = ui_
71 self.path = path 72 if repo:
72 self.__setup_repo(path) 73 self.repo = repo
74 self.path = os.path.normpath(os.path.join(self.repo.path, '..'))
75 elif path:
76 self.path = path
77 self.__setup_repo(path)
78 else:
79 raise TypeError("Expected either path or repo argument")
80
73 self.subdir = subdir 81 self.subdir = subdir
74 if self.subdir and self.subdir[0] == '/': 82 if self.subdir and self.subdir[0] == '/':
75 self.subdir = self.subdir[1:] 83 self.subdir = self.subdir[1:]
76 self.revmap = {} 84 self.revmap = {}
77 if os.path.exists(self.revmap_file): 85 if os.path.exists(self.revmap_file):