Differences between revisions 2 and 3
Revision 2 as of 2010-10-02 12:44:49
Size: 611
Editor: abuehl
Comment:
Revision 3 as of 2010-10-02 17:59:00
Size: 2277
Editor: abuehl
Comment:
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
for two directory entries. Both Linux and Windows NTFS file systems support creating hardlinks.
For filesystems that don't support hardlinks (e.g. Windows FAT), mercurial falls back to copying
all files instead of hardlinking them.
for two directory entries.

Both Linux and Windows NTFS file systems support creating hardlinks. For filesystems that don't support
hardlinks (e.g. Windows FAT), mercurial falls back to copying all files instead of hardlinking them.
Line 9: Line 10:

Clone over http/https or ssh from a remote server implicitly implies --pull.

=== Examples ===

{{{
  $ hg clone http://selenic.com/repo/hg hgcopy
  requesting all changes
  adding changesets
  adding manifests
  adding file changes
  added 12613 changesets with 24932 changes to 1936 files
  updating to branch default
  848 files updated, 0 files merged, 0 files removed, 0 files unresolved
}}}

This was clone over http from a remote server. The resulting clone (hgcopy) thus has no hardlinks.

{{{
  $ hg clone --pull hgcopy hgcopy2
  requesting all changes
  adding changesets
  adding manifests
  adding file changes
  added 12613 changesets with 24932 changes to 1936 files
  updating to branch default
  848 files updated, 0 files merged, 0 files removed, ..
}}}

This was a clone with explicit --pull. The resulting clone (hgcopy2) thus has no hardlinks and
is completely independent from hgcopy.

If mercurial prints "adding changesets" then the resulting clone will have no hardlinks.

{{{
  $ hg clone --debug -U hgcopy2 hgcopy3
  linked 1956 files
}}}

This was a clone which uses hardlinks. The files in hgcopy2 and hgcopy3 (inside the .hg dir) are
hardlinked. Mercurial versions 1.6 and later print the number of files that were hardlinked if
{{{--debug}}} is specified.

{{{
  $ hg clone --debug -U hgcopy2 x:\hgcopy4
  copied 1956 files
}}}

This was a clone where mercurial first tried doing hardlinks, but didn't succeed. For example
the filesystem may not support hardlinks or the source and the destination are not on the same
volume. In this case mercurial falls back to copying the files.

When doing a local clone with a plain 'hg clone A B' mercurial first tries to create hardlinks for files inside .hg. This speeds up cloning and saves harddisk space by using the same physical file for two directory entries.

Both Linux and Windows NTFS file systems support creating hardlinks. For filesystems that don't support hardlinks (e.g. Windows FAT), mercurial falls back to copying all files instead of hardlinking them.

In situations where a hardlinked clone may not be ideal, users can use 'hg clone --pull', which will use the pull protocol for cloning and create a fully independent clone.

Clone over http/https or ssh from a remote server implicitly implies --pull.

Examples

  $ hg clone http://selenic.com/repo/hg hgcopy
  requesting all changes
  adding changesets
  adding manifests
  adding file changes
  added 12613 changesets with 24932 changes to 1936 files
  updating to branch default
  848 files updated, 0 files merged, 0 files removed, 0 files unresolved

This was clone over http from a remote server. The resulting clone (hgcopy) thus has no hardlinks.

  $ hg clone --pull hgcopy hgcopy2
  requesting all changes
  adding changesets
  adding manifests
  adding file changes
  added 12613 changesets with 24932 changes to 1936 files
  updating to branch default
  848 files updated, 0 files merged, 0 files removed, ..

This was a clone with explicit --pull. The resulting clone (hgcopy2) thus has no hardlinks and is completely independent from hgcopy.

If mercurial prints "adding changesets" then the resulting clone will have no hardlinks.

  $ hg clone --debug -U hgcopy2 hgcopy3
  linked 1956 files

This was a clone which uses hardlinks. The files in hgcopy2 and hgcopy3 (inside the .hg dir) are hardlinked. Mercurial versions 1.6 and later print the number of files that were hardlinked if --debug is specified.

  $ hg clone --debug -U hgcopy2 x:\hgcopy4
  copied 1956 files

This was a clone where mercurial first tried doing hardlinks, but didn't succeed. For example the filesystem may not support hardlinks or the source and the destination are not on the same volume. In this case mercurial falls back to copying the files.

HardlinkedClones (last edited 2019-05-16 22:15:46 by AntonGogolev)