comparison mercurial/patch.py @ 5706:89fe5b36c21e

patch: use util.set_flags
author Matt Mackall <mpm@selenic.com>
date Thu, 27 Dec 2007 22:29:21 -0600
parents 1127fe12202a
children 0145f9afb0e7
comparison
equal deleted inserted replaced
5705:4e400863c5ac 5706:89fe5b36c21e
1080 removes.sort() 1080 removes.sort()
1081 repo.remove(removes, True) 1081 repo.remove(removes, True)
1082 for f in patches: 1082 for f in patches:
1083 ctype, gp = patches[f] 1083 ctype, gp = patches[f]
1084 if gp and gp.mode: 1084 if gp and gp.mode:
1085 x = gp.mode & 0100 != 0 1085 flags = ''
1086 l = gp.mode & 020000 != 0 1086 if gp.mode & 0100:
1087 flags = 'x'
1088 elif gp.mode & 020000:
1089 flags = 'l'
1087 dst = os.path.join(repo.root, gp.path) 1090 dst = os.path.join(repo.root, gp.path)
1088 # patch won't create empty files 1091 # patch won't create empty files
1089 if ctype == 'ADD' and not os.path.exists(dst): 1092 if ctype == 'ADD' and not os.path.exists(dst):
1090 repo.wwrite(gp.path, '', x and 'x' or '') 1093 repo.wwrite(gp.path, '', flags)
1091 else: 1094 else:
1092 util.set_link(dst, l) 1095 util.set_flags(dst, flags)
1093 if not l:
1094 util.set_exec(dst, x)
1095 cmdutil.addremove(repo, cfiles) 1096 cmdutil.addremove(repo, cfiles)
1096 files = patches.keys() 1097 files = patches.keys()
1097 files.extend([r for r in removes if r not in files]) 1098 files.extend([r for r in removes if r not in files])
1098 files.sort() 1099 files.sort()
1099 1100