[PATCH] record: do not lose permissions on commit
Steve Borho
steve at borho.org
Sun Jan 25 20:19:06 UTC 2009
# HG changeset patch
# User Steve Borho <steve at borho.org>
# Date 1232914729 21600
# Node ID 88410f5c0f6a2e9773db825e9a90c8ccfbcb9bfa
# Parent 011e69b96c69ca05463eed8306cfb24348483d5b
record: do not lose permissions on commit
diff --git a/hgext/record.py b/hgext/record.py
--- a/hgext/record.py
+++ b/hgext/record.py
@@ -10,7 +10,7 @@
from mercurial.i18n import gettext, _
from mercurial import cmdutil, commands, extensions, hg, mdiff, patch
from mercurial import util
-import copy, cStringIO, errno, operator, os, re, tempfile
+import copy, cStringIO, errno, operator, os, re, shutil, tempfile
lines_re = re.compile(r'@@ -(\d+),(\d+) \+(\d+),(\d+) @@\s*(.*)')
@@ -469,6 +469,9 @@
# 3a. apply filtered patch to clean repo (clean)
if backups:
hg.revert(repo, repo.dirstate.parents()[0], backups.has_key)
+ # Copy permissions back to cleaned files
+ for realname, tmpname in backups.iteritems():
+ shutil.copymode(tmpname, repo.wjoin(realname))
# 3b. (apply)
if dopatch:
More information about the Mercurial-devel
mailing list