# HG changeset patch # User Adrian Buehlmann # Date 1275060514 -7200 # Node ID e4dbaa40096d56f7178be7d82fa7b0d728801670 # Parent 640d419725d057492a63f4e9d84d49ff5111607c clone: save hardlink state of util.copyfiles() When trying to do hardlink-cloning, the os_link() call of the first file tried already fails on Windows, if the source is on a UNC path. This change avoids calling os_link() for the rest of files, leaving us with a *single* failed os_link() call per clone operation, if the source can't do hardlinks. diff -r 640d419725d0 -r e4dbaa40096d mercurial/hg.py --- a/mercurial/hg.py Fri May 28 17:28:34 2010 +0200 +++ b/mercurial/hg.py Fri May 28 17:28:34 2010 +0200 @@ -277,6 +277,7 @@ % dest) raise + hardlink = None for f in src_repo.store.copylist(): src = os.path.join(src_repo.sharedpath, f) dst = os.path.join(dest_path, f) @@ -287,7 +288,7 @@ if dst.endswith('data'): # lock to avoid premature writing to the target dest_lock = lock.lock(os.path.join(dstbase, "lock")) - util.copyfiles(src, dst) + hardlink = util.copyfiles(src, dst, hardlink) # we need to re-init the repo after manually copying the data # into it