##// END OF EJS Templates
patch: use util.set_flags
Matt Mackall -
r5706:89fe5b36 default
parent child Browse files
Show More
@@ -1082,16 +1082,17 b' def updatedir(ui, repo, patches):'
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])
General Comments 0
You need to be logged in to leave comments. Login now