Mercurial > hg > hg-fastimport
comparison hgext3rd/fastimport/hgechoprocessor.py @ 79:59a9e4d0aa72
Move hgfastimport directory to hgext3rd/fastimport
This will allow hgrc to enable this extension like so:
[extensions]
fastimport =
| author | Roy Marples <roy@marples.name> |
|---|---|
| date | Mon, 18 Jan 2021 23:04:05 +0000 |
| parents | hgfastimport/hgechoprocessor.py@08e2157aaa9a |
| children | e6602cc471d5 |
comparison
equal
deleted
inserted
replaced
| 74:a4f13dc5e3f7 | 79:59a9e4d0aa72 |
|---|---|
| 1 # Copyright (C) 2008 Canonical Ltd | |
| 2 # | |
| 3 # This program is free software; you can redistribute it and/or modify | |
| 4 # it under the terms of the GNU General Public License as published by | |
| 5 # the Free Software Foundation; either version 2 of the License, or | |
| 6 # (at your option) any later version. | |
| 7 # | |
| 8 # This program is distributed in the hope that it will be useful, | |
| 9 # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 11 # GNU General Public License for more details. | |
| 12 # | |
| 13 # You should have received a copy of the GNU General Public License | |
| 14 # along with this program; if not, write to the Free Software | |
| 15 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
| 16 | |
| 17 """Processor of import commands. | |
| 18 | |
| 19 This module provides core processing functionality including an abstract class | |
| 20 for basing real processors on. See the processors package for examples. | |
| 21 """ | |
| 22 | |
| 23 from fastimport import processor | |
| 24 | |
| 25 class HgEchoProcessor(processor.ImportProcessor): | |
| 26 | |
| 27 def __init__(self, ui, repo, **opts): | |
| 28 self.ui = ui | |
| 29 self.repo = repo | |
| 30 self.opts = opts | |
| 31 self.finished = False | |
| 32 | |
| 33 def progress_handler(self, cmd): | |
| 34 self.ui.write(cmd.dump_str(verbose=True) + "\n") | |
| 35 | |
| 36 def blob_handler(self, cmd): | |
| 37 self.ui.write(cmd.dump_str(verbose=True) + "\n") | |
| 38 | |
| 39 def checkpoint_handler(self, cmd): | |
| 40 self.ui.write(cmd.dump_str(verbose=True) + "\n") | |
| 41 | |
| 42 def commit_handler(self, cmd): | |
| 43 commit_handler = HgEchoCommitHandler(cmd, self.ui, self.repo, **self.opts) | |
| 44 commit_handler.process() | |
| 45 self.ui.write(cmd.dump_str(verbose=True) + "\n") | |
| 46 | |
| 47 def reset_handler(self, cmd): | |
| 48 self.ui.write(cmd.dump_str(verbose=True) + "\n") | |
| 49 | |
| 50 def tag_handler(self, cmd): | |
| 51 self.ui.write(cmd.dump_str(verbose=True) + "\n") | |
| 52 | |
| 53 class HgEchoCommitHandler(processor.CommitHandler): | |
| 54 | |
| 55 def __init__(self, command, ui, repo, **opts): | |
| 56 self.command = command | |
| 57 self.ui = ui | |
| 58 self.repo = repo | |
| 59 self.opts = opts | |
| 60 | |
| 61 def modify_handler(self, filecmd): | |
| 62 self.ui.write(filecmd.dump_str(verbose=True) + "\n") | |
| 63 | |
| 64 def delete_handler(self, filecmd): | |
| 65 self.ui.write(filecmd.dump_str(verbose=True) + "\n") | |
| 66 | |
| 67 def copy_handler(self, filecmd): | |
| 68 self.ui.write(filecmd.dump_str(verbose=True) + "\n") | |
| 69 | |
| 70 def rename_handler(self, filecmd): | |
| 71 self.ui.write(filecmd.dump_str(verbose=True) + "\n") | |
| 72 | |
| 73 def deleteall_handler(self, filecmd): | |
| 74 self.ui.write(filecmd.dump_str(verbose=True) + "\n") |
