Refactoring common RunOptions code
Greg Ward <[email protected]>
| Newsgroups | gmane.comp.version-control.subversion.cvs2svn.devel |
|---|---|
| Message-ID | <[email protected]> |
I was just about to send my next patch, which adds hg_run_options.py.
But then I remembered that it's got a bunch of code copied straight
from svn_run_options.py: blecch. Specifically:
# XXX copied from SVNRunOptions: refactor!!!
def _get_extraction_options_group(self):
[...]
# XXX copied from svn_run_options.py
def callback_manpage(self, option, opt_str, value, parser):
[...]
# XXX copied from SVNRunOptions: refactor!!!
def process_extraction_options(self):
[...]
Additionally, I have some similar comments in git_run_options.py:
# XXX shouldn't this be the same as -- or, better, shared with --
# SVNRunOptions?
def _get_extraction_options_group(self):
[...]
# XXX not quite the same as same method in SVNRunOptions, but it
# probably should be
def process_extraction_options(self):
[...]
And callback_manpage() is identical too.
Two questions:
1) should I just submit hg_run_options.py as-is and refactor later? or
do you want the refactoring done first?
2) how to refactor? it looks like the obvious thing to do is move the
common code up to RunOptions. This will be trivial for HgRunOptions,
since I deliberately did not change the copied methods. But
GitRunOptions might need a bit more work to re-unify.
Greg
------------------------------------------------------
http://cvs2svn.tigris.org/ds/viewMessage.do?dsForumId=1667&dsMessageId=2387542
To unsubscribe from this discussion, e-mail: [[email protected]].