![]() The workaround unconditionally makes a full copy of each file before writing to it if the file is on a windows network share, thus making sure any hardlinks that may exist on that file are broken up. This means mercurial running on a client gets a wrong hardlink count for files which are part of a hardlinked clone that resides on a windows network share.Ī workaround for Mercurial running on Windows for this has been first released with mercurial 1.6.3 (see WhatsNew). Windows computers that serve files on a share always report a count of one when asked for the number of hardlinks a file has, even if a file actually does have hardlinks and thus the correct number reported should be two or more. Mercurial versions up to 1.6.2 suffer from a bug which is present in nearly all Windows variants (including Windows 7). In this case mercurial falls back to copying the files. For example the filesystem may not support hardlinks or the source and the destination are not on the same volume. ![]() This was a clone where mercurial first tried doing hardlinks, but didn't succeed. Mercurial versions 1.6 and later print the number of files that were hardlinked if -debug is specified. The files in hgcopy2 and hgcop圓 (inside the. If mercurial prints "adding changesets" then the resulting clone will have no hardlinks. ![]() The resulting clone (hgcopy2) thus has no hardlinks and is completely independent from hgcopy. The resulting clone (hgcopy) thus has no hardlinks.Ĩ48 files updated, 0 files merged, 0 files removed. This was clone over http from a remote server. Breaking up the hardlink for a file X means (1) copying X to a temporary file, (2) deleting X and then (3) renaming the tempfile back to X.Īdded 12613 changesets with 24932 changes to 1936 filesĨ48 files updated, 0 files merged, 0 files removed, 0 files unresolved If the count is two or more, mercurial breaks up the hardlink for X before writing to it. When committing or pushing to a repository, mercurial checks the hardlink count for every file X it needs to write to inside. 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.Ĭloning over http/https or ssh from a remote server implicitly implies -pull. Windows FAT), mercurial falls back to copying all files instead of hardlinking them. For filesystems that don't support hardlinks (e.g. If you have any secret changesets in your repository, then a local clone will not be using hardlinks.īoth Linux and Windows NTFS file systems support hardlinks (but note that NTFS limits the maximum number of hardlinks per file to 1023). This speeds up cloning and saves harddisk space by using the same physical file for two or more directory entries. When doing a local clone with a plain hg clone A B mercurial first tries to create hardlinks for files inside the.
0 Comments
Leave a Reply. |