[issue919] Command 'hg hardlink'

Jesse Glick mercurial-bugs at selenic.com
Mon Jan 7 14:50:30 CST 2008


New submission from Jesse Glick <jesse.glick at sun.com>:

'hg clone -r' fails to use hardlinks even for storage files which are unchanged
relative to the origin repository. This wastes quite a bit of disk space when
creating a truncated clone which has most of the changesets as in the original.
And there are other cases where some storage files could be retroactively
hardlinked to save space.

Suggest a command 'hg hardlink' (perhaps in an extension?) which would have the
same effect as

http://www.selenic.com/mercurial/wiki/index.cgi/TipsAndTricks#head-f6c2fdd99afc10b3af2234f63eb91dda0e01145f

For example, to get a copy of a server-hosted release while minimizing both
local storage and network traffic:

hg clone -r 1.0 main release-1.0
hg -R release-1.0 pull -u http://nowhere.net/hg/release-1.0
hg hardlink main release-1.0

Probably the command can just print a warning, rather than abort with an error
code, if hardlinks are not supported between the two dirs for any reason; after
all, it is just a performance optimization, and the number of files which can
actually be hardlinked anyway is not easily predictable.

Will submit patch on request if this seems like a good idea. I have heard other
complaints that the "quick and dirty" technique is too cumbersome or scary to be
recommended.

----------
messages: 4838
nosy: jglick
priority: wish
status: unread
title: Command 'hg hardlink'
topic: performance

____________________________________________________
Mercurial issue tracker <mercurial-bugs at selenic.com>
<http://www.selenic.com/mercurial/bts/issue919>
____________________________________________________



More information about the Mercurial-devel mailing list