branching: merge with stable
authorMartin von Zweigbergk <martinvonz@google.com>
Thu, 12 May 2022 07:36:37 -0700
changeset 49180 c577d394ed6b
parent 49177 90a15199cbc6 (current diff)
parent 49179 df68d64b0d50 (diff)
child 49182 e3ac39edaa94
branching: merge with stable
mercurial/cmdutil.py
mercurial/filelog.py
--- a/.hgsigs	Thu Apr 21 10:39:52 2022 -0700
+++ b/.hgsigs	Thu May 12 07:36:37 2022 -0700
@@ -226,3 +226,4 @@
 c00d3ce4e94bb0ee8d809e25e1dcb2a5fab84e2c 0 iQHNBAABCgA3FiEEH2b4zfZU6QXBHaBhoR4BzQ4F2VYFAmIPn9oZHGFscGhhcmVAcmFwaGFlbGdvbWVzLmRldgAKCRChHgHNDgXZVpamDACfmZw0FscQ6oCs1ZyWZ2sf6xxYnk242h4ca8fyILrGfuhlgkochlMwF8id3EPVKnie3QHBi33Nf5Tz9eFTFR4z/eQ5W8R+bjYWo/F+4FDkaTIprvg4gfoH1MklmpVhPa7MFVmp7tmSx/0EVdpJuMkJSeAU1kQ6Mq8ekMWQT4vtLbkAOGZcnwKiU57j8cYnOjoIqA+22/S0DBWMKjEnuz3k8TjplsZXVgTEUelFAwT4SC3qNSIBvVYyDmdAoD0C4zL88tErY0MeQ/ehId6E1khLvw9I65z/f2hOxXiDdk0b6WV2MCh1rxCX5RUiH0aNUmG+hGphpH0VVqQihkQEIdzZhXiFVlEc/rAbdt3g7pVc2RuWSanBUEOcvly0r40A2wRCka1jjgfz7dtmjZ91SKCPpOUdxHfaqqWz/0Y/oIgpq/UM+1fufDxeLZG+OY8B5y+c+ZUuGacAVNRQku6IB+0dT4/DTEsYWT3VMIH0ZzGFiAQ2g3IPo6qlLFK54LztXTg=
 d4486810a1795fba9521449b8885ced034f3a6dd 0 iQHNBAABCgA3FiEEH2b4zfZU6QXBHaBhoR4BzQ4F2VYFAmIePhwZHGFscGhhcmVAcmFwaGFlbGdvbWVzLmRldgAKCRChHgHNDgXZVm3LC/wP9h6bFiy1l3fJhmq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dKMus/4Gm9cqTnYg3Bt8jZ3lupeYMv9ZSFmKDG8A69QFLKYKzd/FFx0=
+0ddd5e1f5f67438af85d12e4ce6c39021dde9916 0 iQHNBAABCgA3FiEEH2b4zfZU6QXBHaBhoR4BzQ4F2VYFAmJyo/kZHGFscGhhcmVAcmFwaGFlbGdvbWVzLmRldgAKCRChHgHNDgXZVsTVDACmg+uABE36kJcVJewoVK2I2JAdrO2llq3QbvzNb0eRL7bGy5UKJvF7fy/1FfayZT9/YTc6kGcRIeG+jUUiGRxMr0fOP9RixG78OyV14MmN1vkNTfMbk6BBrkYRbJJioLyk9qsXU6HbfRUdaCkOqwOKXKHm/4lzG/JFvL4JL6v++idx8W/7sADKILNy2DtP22YaRMgz38iM3ejgZghw7ie607C6lYq4wMs39jTZdZ3s6XoN+VgsLJWsI1LFnIADU5Zry8EAFERsvphiM2zG8lkrbPjpvwtidBz999TYnnGLvTMZA5ubspQRERc/eNDRbKdA55cCWNg3DhTancOiu3bQXdYCjF1MCN9g5Q11zbEzdwrbrY0NF7AUq1VW4kGFgChIJ0IuTQ/YETbcbih2Xs4nkAGt64YPtHzmOffF1a2/SUzH3AwgMmhBQBqxa02YTqyKJDHHqgTyFrZIkH/jb+rdfIskaOZZo6JcGUoacFOUhFfhSxxB1kN2HEHvEAQPMkc=
--- a/.hgtags	Thu Apr 21 10:39:52 2022 -0700
+++ b/.hgtags	Thu May 12 07:36:37 2022 -0700
@@ -239,3 +239,4 @@
 c00d3ce4e94bb0ee8d809e25e1dcb2a5fab84e2c 6.1rc0
 d4486810a1795fba9521449b8885ced034f3a6dd 6.1
 5bd6bcd31dd1ebb63b8914b00064f96297267af7 6.1.1
+0ddd5e1f5f67438af85d12e4ce6c39021dde9916 6.1.2
--- a/mercurial/cmdutil.py	Thu Apr 21 10:39:52 2022 -0700
+++ b/mercurial/cmdutil.py	Thu May 12 07:36:37 2022 -0700
@@ -2914,9 +2914,9 @@
         # filectxs from the old commit.
         if changes or changeset_copies:
             # Recompute copies (avoid recording a -> b -> a)
-            copied = copies.pathcopies(base, wctx, matcher)
-            if old.p2:
-                copied.update(copies.pathcopies(old.p2(), wctx, matcher))
+            copied = copies.pathcopies(base, wctx)
+            if old.p2():
+                copied.update(copies.pathcopies(old.p2(), wctx))
 
             # Prune files which were reverted by the updates: if old
             # introduced file X and the file was renamed in the working
--- a/mercurial/filelog.py	Thu Apr 21 10:39:52 2022 -0700
+++ b/mercurial/filelog.py	Thu May 12 07:36:37 2022 -0700
@@ -202,10 +202,10 @@
 
         # for revisions with renames, we have to go the slow way
         node = self.node(rev)
+        if self.iscensored(rev):
+            return 0
         if self.renamed(node):
             return len(self.read(node))
-        if self.iscensored(rev):
-            return 0
 
         # XXX if self.read(node).startswith("\1\n"), this returns (size+4)
         # XXX See also basefilectx.cmp.
--- a/tests/test-amend.t	Thu Apr 21 10:39:52 2022 -0700
+++ b/tests/test-amend.t	Thu May 12 07:36:37 2022 -0700
@@ -609,3 +609,20 @@
   >   hg status
   > fi
   OK.
+
+Amending a commit that has copies but not specifying those copies shouldn't
+cause them to be lost
+
+  $ cd $TESTTMP
+  $ hg init dont-lose-copies; cd dont-lose-copies
+  $ echo r0 > r0; hg commit -qAm "r0"
+  $ hg cp r0 r0_copied; hg commit -qm "copy r0"
+  $ echo hi > new_file_amend_me
+  $ hg status --change . --copies
+  A r0_copied
+    r0
+  $ hg amend -qA new_file_amend_me
+  $ hg status --change . --copies
+  A new_file_amend_me
+  A r0_copied
+    r0
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-censor2.t	Thu May 12 07:36:37 2022 -0700
@@ -0,0 +1,22 @@
+  $ cat >> $HGRCPATH <<EOF
+  > [censor]
+  > policy=ignore
+  > EOF
+
+  $ mkdir r
+  $ cd r
+  $ hg init
+  $ echo secret > target
+  $ hg commit -Am "secret"
+  adding target
+  $ touch bystander
+  $ hg commit -Am "innocent"
+  adding bystander
+  $ echo erased-secret > target
+  $ hg commit -m "erased secret"
+  $ hg censor target --config extensions.censor= -r ".^^"
+  $ hg update ".^"
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cat target
+  $ hg update tip
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved