# HG changeset patch # User Matt Mackall # Date 1198816161 21600 # Node ID 89fe5b36c21ee24d75f5110e919522505d26bae6 # Parent 4e400863c5ac71c1c29771d356a7c980552e75b3 patch: use util.set_flags diff -r 4e400863c5ac -r 89fe5b36c21e mercurial/patch.py --- a/mercurial/patch.py Thu Dec 27 22:29:17 2007 -0600 +++ b/mercurial/patch.py Thu Dec 27 22:29:21 2007 -0600 @@ -1082,16 +1082,17 @@ for f in patches: ctype, gp = patches[f] if gp and gp.mode: - x = gp.mode & 0100 != 0 - l = gp.mode & 020000 != 0 + flags = '' + if gp.mode & 0100: + flags = 'x' + elif gp.mode & 020000: + flags = 'l' dst = os.path.join(repo.root, gp.path) # patch won't create empty files if ctype == 'ADD' and not os.path.exists(dst): - repo.wwrite(gp.path, '', x and 'x' or '') + repo.wwrite(gp.path, '', flags) else: - util.set_link(dst, l) - if not l: - util.set_exec(dst, x) + util.set_flags(dst, flags) cmdutil.addremove(repo, cfiles) files = patches.keys() files.extend([r for r in removes if r not in files])