changeset 21252:da0eb4970913

relink: declare command using decorator
author Gregory Szorc <gregory.szorc@gmail.com>
date Sun, 04 May 2014 21:52:25 -0700
parents a836fa58b512
children d2ce7a20fe86
files hgext/relink.py
diffstat 1 files changed, 4 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/relink.py	Sun May 04 22:35:37 2014 -0700
+++ b/hgext/relink.py	Sun May 04 21:52:25 2014 -0700
@@ -7,12 +7,15 @@
 
 """recreates hardlinks between repository clones"""
 
-from mercurial import hg, util
+from mercurial import cmdutil, hg, util
 from mercurial.i18n import _
 import os, stat
 
+cmdtable = {}
+command = cmdutil.command(cmdtable)
 testedwith = 'internal'
 
+@command('relink', [], _('[ORIGIN]'))
 def relink(ui, repo, origin=None, **opts):
     """recreate hardlinks between two repositories
 
@@ -178,11 +181,3 @@
 
     ui.status(_('relinked %d files (%s reclaimed)\n') %
               (relinked, util.bytecount(savedbytes)))
-
-cmdtable = {
-    'relink': (
-        relink,
-        [],
-        _('[ORIGIN]')
-    )
-}