diff options
author | Lars Wirzenius <liw@liw.fi> | 2012-03-12 17:41:30 +0000 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2012-03-12 17:41:30 +0000 |
commit | 08627e99f7c4452b077bbdfabdb7094fff9e79ca (patch) | |
tree | a6f1854982b2dd95bc3abf6bfadb0aa40575b0fb | |
parent | 0e49c9b229f4ee1b67089f2b4695cdad1a839aff (diff) | |
download | dupfiles-08627e99f7c4452b077bbdfabdb7094fff9e79ca.tar.gz |
Make --no-act work for hardlinks too
-rwxr-xr-x | dupfiles | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -249,8 +249,11 @@ class Dupfiles(cliapp.Application): same = [x for x, y in dups if y == meta] dups = [(x,y) for x, y in dups if y != meta] for pathname in same: - os.remove(pathname) - os.link(canonical, pathname) + if self.settings['no-act']: + self.output.write('hardlink %s\n' % pathname) + else: + os.remove(pathname) + os.link(canonical, pathname) def remove_all_but_one(self, duplicates, last_dir): if not last_dir.endswith(os.sep): |