Mercurial > hg > hg-git
comparison hggit/__init__.py @ 1013:a4f4f861fc5e
git_handler: replace repo.opener with repo.vfs
repo.opener() is now deprecated, so repo.vfs() should be used instead.
author | Arun Kulshreshtha <kulshrax@fb.com> |
---|---|
date | Thu, 09 Mar 2017 12:33:05 -0800 |
parents | 6d1c19dceaf4 |
children | 7835460756d4 |
comparison
equal
deleted
inserted
replaced
1012:438b2fc58701 | 1013:a4f4f861fc5e |
---|---|
260 | 260 |
261 @command('git-cleanup') | 261 @command('git-cleanup') |
262 def git_cleanup(ui, repo): | 262 def git_cleanup(ui, repo): |
263 '''clean up Git commit map after history editing''' | 263 '''clean up Git commit map after history editing''' |
264 new_map = [] | 264 new_map = [] |
265 for line in repo.opener(GitHandler.map_file): | 265 for line in repo.vfs(GitHandler.map_file): |
266 gitsha, hgsha = line.strip().split(' ', 1) | 266 gitsha, hgsha = line.strip().split(' ', 1) |
267 if hgsha in repo: | 267 if hgsha in repo: |
268 new_map.append('%s %s\n' % (gitsha, hgsha)) | 268 new_map.append('%s %s\n' % (gitsha, hgsha)) |
269 f = repo.opener(GitHandler.map_file, 'wb') | 269 f = repo.vfs(GitHandler.map_file, 'wb') |
270 map(f.write, new_map) | 270 map(f.write, new_map) |
271 ui.status(_('git commit map cleaned\n')) | 271 ui.status(_('git commit map cleaned\n')) |
272 | 272 |
273 def findcommonoutgoing(orig, repo, other, *args, **kwargs): | 273 def findcommonoutgoing(orig, repo, other, *args, **kwargs): |
274 if isinstance(other, gitrepo.gitrepo): | 274 if isinstance(other, gitrepo.gitrepo): |