Commits

Benoit Boissinot  committed e37f9d3

remove decorators (compat with python2.3)

  • Participants
  • Parent commits 3f1e8a5

Comments (0)

Files changed (9)

     return diff
 
 
-@util.register_subcommand('diff')
 def diff_command(ui, repo, hg_repo_path, **opts):
     """Show a diff of the most recent revision against its parent from svn.
     """
                                                   'text': False,
                                                   }))
     ui.write(filterdiff(''.join(it), base_rev))
+diff_command = util.register_subcommand('diff')(diff_command)

File fetch_command.py

               "as good a job. You should really upgrade your server.\n")
 
 
-@util.register_subcommand('pull')
 def fetch_revisions(ui, svn_url, hg_repo_path, skipto_rev=0, stupid=None,
                     tag_locations='tags',
                     authors=None,
                     else:
                         raise
     merc_util._encoding = old_encoding
+fetch_revisions = util.register_subcommand('pull')(fetch_revisions)
 
 
 def cleanup_file_handles(svn, count):

File hg_delta_editor.py

                     % (filemapfile, line.rstrip()))
         f.close()
 
-    @property
     def meta_data_dir(self):
         return os.path.join(self.path, '.hg', 'svn')
+    meta_data_dir = property(meta_data_dir)
 
     def meta_file_named(self, name):
         return os.path.join(self.meta_data_dir, name)
 
-    @property
     def revmap_file(self):
         return self.meta_file_named('rev_map')
+    revmap_file = property(revmap_file)
 
-    @property
     def svn_url_file(self):
         return self.meta_file_named('url')
+    svn_url_file = property(svn_url_file)
 
-    @property
     def uuid_file(self):
         return self.meta_file_named('uuid')
+    uuid_file = property(uuid_file)
 
-    @property
     def last_revision_handled_file(self):
         return self.meta_file_named('last_rev')
+    last_revision_handled_file = property(last_revision_handled_file)
 
-    @property
     def branch_info_file(self):
         return self.meta_file_named('branch_info')
+    branch_info_file = property(branch_info_file)
 
-    @property
     def tag_info_file(self):
         return self.meta_file_named('tag_info')
+    tag_info_file = property(tag_info_file)
 
-    @property
     def tag_locations_file(self):
         return self.meta_file_named('tag_locations')
+    tag_locations_file = property(tag_locations_file)
 
-    @property
     def url(self):
         return open(self.svn_url_file).read()
+    url = property(url)
 
-    @property
     def authors_file(self):
         return self.meta_file_named('authors')
+    authors_file = property(authors_file)
 
-    @stash_exception_on_self
     def delete_entry(self, path, revision_bogus, parent_baton, pool=None):
         br_path, branch = self._path_and_branch_for_path(path)
         if br_path == '':
                     if f_p not in self.current_files:
                         self.delete_file(f_p)
             self.delete_file(path)
+    delete_entry = stash_exception_on_self(delete_entry)
 
-    @stash_exception_on_self
     def open_file(self, path, parent_baton, base_revision, p=None):
         self.current_file = 'foobaz'
         fpath, branch = self._path_and_branch_for_path(path)
             else:
                 self.base_revision = None
             self.should_edit_most_recent_plaintext = True
+    open_file = stash_exception_on_self(open_file)
 
     def aresamefiles(self, parentctx, childctx, files):
         """Assuming all files exist in childctx and parentctx, return True
         # parentctx is not an ancestor of childctx, files are unrelated
         return False
 
-    @stash_exception_on_self
     def add_file(self, path, parent_baton, copyfrom_path,
                  copyfrom_revision, file_pool=None):
         self.current_file = 'foobaz'
                 parentctx = self.repo.changectx(parentid)
                 if self.aresamefiles(parentctx, ctx, [from_file]):
                     self.copies[path] = from_file
+    add_file = stash_exception_on_self(add_file)
 
-    @stash_exception_on_self
     def add_directory(self, path, parent_baton, copyfrom_path,
                       copyfrom_revision, dir_pool=None):
         self.dir_batons[path] = path
                 if self.aresamefiles(parentctx, cp_f_ctx, copies.values()):
                     self.copies.update(copies)
         return path
+    add_directory = stash_exception_on_self(add_directory)
 
-    @stash_exception_on_self
     def change_file_prop(self, file_baton, name, value, pool=None):
         if name == 'svn:executable':
             self.current_files_exec[self.current_file] = bool(value is not None)
         elif name == 'svn:special':
             self.current_files_symlink[self.current_file] = bool(value is not None)
+    change_file_prop = stash_exception_on_self(change_file_prop)
 
-    @stash_exception_on_self
     def change_dir_prop(self, dir_baton, name, value, pool=None):
         if dir_baton is None:
             return
         path = self.dir_batons[dir_baton]
         if name == 'svn:externals':
             self.externals[path] = value
+    change_dir_prop = stash_exception_on_self(change_dir_prop)
 
-    @stash_exception_on_self
     def open_directory(self, path, parent_baton, base_revision, dir_pool=None):
         self.dir_batons[path] = path
         p_, branch = self._path_and_branch_for_path(path)
         if p_ == '':
             self.commit_branches_empty[branch] = False
         return path
+    open_directory = stash_exception_on_self(open_directory)
 
-    @stash_exception_on_self
     def close_directory(self, dir_baton, dir_pool=None):
         if dir_baton is not None:
             del self.dir_batons[dir_baton]
+    close_directory = stash_exception_on_self(close_directory)
 
-    @stash_exception_on_self
     def apply_textdelta(self, file_baton, base_checksum, pool=None):
         base = ''
         if not self._is_path_valid(self.current_file):
                 self._exception_info = sys.exc_info()
                 raise
         return txdelt_window
+    apply_textdelta = stash_exception_on_self(apply_textdelta)
 
 class MissingPlainTextError(Exception):
     """Exception raised when the repo lacks a source file required for replaying
 import utility_commands
 
 
-@util.register_subcommand('push')
-@util.register_subcommand('dcommit') # for git expats
 def push_revisions_to_subversion(ui, repo, hg_repo_path, svn_url,
                                  stupid=False, **opts):
     """Push revisions starting at a specified head back to Subversion.
         svn_commit_hashes = dict(zip(hge.revmap.itervalues(), hge.revmap.iterkeys()))
     merc_util._encoding = oldencoding
     return 0
+push_revisions_to_subversion = util.register_subcommand('push')(push_revisions_to_subversion)
+# for git expats
+push_revisions_to_subversion = util.register_subcommand('dcommit')(push_revisions_to_subversion)
 
 def _isdir(svn, branchpath, svndir):
     try:

File rebuildmeta.py

 import svnwrap
 import util
 
-@util.register_subcommand('rebuildmeta')
 def rebuildmeta(ui, repo, hg_repo_path, args, **opts):
     """Rebuild hgsubversion metadata using values stored in revisions.
     """
     tagsinfofile = open(os.path.join(svnmetadir, 'tag_info'), 'w')
     pickle.dump(tagsinfo, tagsinfofile)
     tagsinfofile.close()
+rebuildmeta = util.register_subcommand('rebuildmeta')(rebuildmeta)
 
 
 def determinebranch(branch):

File svncommand.py

             raise
 
 
-@register_subcommand('help')
 def help_command(ui, args=None, **opts):
     """Get help on the subsubcommands.
     """
         ui.status(doc.strip(), '\n')
         return
     ui.status(generate_help())
+help_command = register_subcommand('help')(help_command)
 
-@register_subcommand('up')
 def update(ui, args, repo, clean=False, **opts):
     """Update to a specified Subversion revision number.
     """
         ui.status('\n'.join(['%s on %s' % (node.hex(a[0]), a[1]) for a in
                              answers]+['']))
     return 1
+update = register_subcommand('up')(update)
 
 
-@register_subcommand('verify_revision')
 def verify_revision(ui, args, repo, force=False, **opts):
     """Verify a single converted revision.
     Note: This wipes your working copy and then exports the corresponding
             ui.status('OK.\n')
             return 0
     return 1
+verify_revision = register_subcommand('verify_revision')(verify_revision)
 
-@register_subcommand('verify_all_revisions')
 def verify_all_revisions(ui, args, repo, **opts):
     """Verify all the converted revisions
     optionally starting at a revision.
             print revnum, 'failed'
             return 1
     return 0
+verify_all_revisions = register_subcommand('verify_all_revisions')(verify_all_revisions)

File svnwrap/svn_ctypes_wrapper.py

         # TODO(augie) need to figure out a way to do auth
         self.repo = repos.RemoteRepository(self.svn_url)
 
-    @property
     def HEAD(self):
         raise NotImplementedError
+    HEAD = property(HEAD)
 
-    @property
     def START(self):
         return 0
+    START = property(START)
 
-    @property
     def branches(self):
         """Get the branches defined in this repo assuming a standard layout.
         """
         raise NotImplementedError
+    branches = property(branches)
 
-    @property
     def tags(self):
         """Get the current tags in this repo assuming a standard layout.
 
         This returns a dictionary of tag: (source path, source rev)
         """
         raise NotImplementedError
+    tags = property(tags)
 
     def _get_copy_source(self, path, cached_head=None):
         """Get copy revision for the given path, assuming it was meant to be

File svnwrap/svn_swig_wrapper.py

         self.ra = ra.open2(self.svn_url.encode('utf-8'), callbacks,
                            svn_config, self.pool)
 
-    @property
     def HEAD(self):
         return ra.get_latest_revnum(self.ra, self.pool)
+    HEAD = property(HEAD)
 
-    @property
     def START(self):
         return 0
+    START = property(START)
 
-    @property
     def branches(self):
         """Get the branches defined in this repo assuming a standard layout.
         """
             if source is not None and source_rev is not None:
                 branch_info[b] = (source, source_rev, hist.revnum)
         return branch_info
+    branches = property(branches)
 
-    @property
     def tags(self):
         """Get the current tags in this repo assuming a standard layout.
 
         This returns a dictionary of tag: (source path, source rev)
         """
         return self.tags_at_rev(self.HEAD)
+    tags = property(tags)
 
     def tags_at_rev(self, revision):
         try:

File utility_commands.py

 import util
 import hg_delta_editor
 
-@util.register_subcommand('url')
 def print_wc_url(ui, repo, hg_repo_path, **opts):
     """Url of Subversion repository.
     """
     hge = hg_delta_editor.HgChangeReceiver(hg_repo_path,
                                            ui_=ui)
     ui.status(hge.url, '\n')
+print_wc_url = util.register_subcommand('url')(print_wc_url)
 
 
-@util.register_subcommand('info')
 def run_svn_info(ui, repo, hg_repo_path, **opts):
     """Like svn info details.
     """
                'date': mutil.datestr(workingctx.date(),
                                      '%Y-%m-%d %H:%M:%S %1%2 (%a, %d %b %Y)')
               })
+run_svn_info = util.register_subcommand('info')(run_svn_info)
 
 
-@util.register_subcommand('parent')
 def print_parent_revision(ui, repo, hg_repo_path, **opts):
     """Display hg hash and svn revision of nearest svn parent.
     """
     else:
         ui.status('Working copy seems to have no parent svn revision.\n')
     return 0
+print_parent_revision = util.register_subcommand('parent')(print_parent_revision)
 
 
-@util.register_subcommand('rebase')
 def rebase_commits(ui, repo, hg_repo_path, extrafn=None, sourcerev=None, **opts):
     """Rebases current unpushed revisions onto Subversion head.
 
     return rebase.rebase(ui, repo, dest=node.hex(target_rev.node()),
                          base=node.hex(sourcerev),
                          extrafn=extrafn)
+rebase_commits = util.register_subcommand('rebase')(rebase_commits)
 
 
-@util.register_subcommand('outgoing')
 def show_outgoing_to_svn(ui, repo, hg_repo_path, **opts):
     """Show changesets not yet pushed to SVN.
     """
     displayer = cmdutil.show_changeset(ui, repo, opts, buffered=False)
     for node in reversed(o_r):
         displayer.show(repo[node])
+show_outgoing_to_svn = util.register_subcommand('outgoing')(show_outgoing_to_svn)