Comments
Patch
@@ -2,22 +2,25 @@
#
# Copyright (C) 2007 Brendan Cully <brendan@kublai.com>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
"""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
When repositories are cloned locally, their data files will be
hardlinked so that they only use the space of a single repository.
Unfortunately, subsequent pulls into either repository will break
hardlinks for any files touched by the new changesets, even if
@@ -173,16 +176,8 @@ def do_relink(src, dst, files, ui):
savedbytes += sz
except OSError, inst:
ui.warn('%s: %s\n' % (tgt, str(inst)))
ui.progress(_('relinking'), None)
ui.status(_('relinked %d files (%s reclaimed)\n') %
(relinked, util.bytecount(savedbytes)))
-
-cmdtable = {
- 'relink': (
- relink,
- [],
- _('[ORIGIN]')
- )
-}