##// END OF EJS Templates
mq: add parent node IDs to MQ patches on qrefresh/qnew...
mq: add parent node IDs to MQ patches on qrefresh/qnew The goal of this patch is to add the IDs of the parents of applied MQ patches into the patch file headers whenever qnew or qrefresh are run. This will serve as a reminder of when the patches last applied cleanly and will let us do more intelligent things in the future, such as: * Resolve conflicts found when qpushing to a new location by merging instead of simply showing rejects. * Display better diffs of versioned MQ patches because we can tell how the patched files have changed in the meantime. Here are the new rules this patch introduces. They are checked in this order: * If a patch currently has old, plain-style patch headers ("From:" and "Date:") do not change the style or add any new headers. * If the 'mq.plain' configuration setting is true, only plain-style headers will be used for all MQ patches. * qnew will initialize new patches with HG-style headers and fill in the "# Parent" header with the appropriate parent node. * qrefresh will refresh the "# Parent" header with the current parent of the current patch.

File last commit:

r10397:8cb81d75 default
r10397:8cb81d75 default
Show More
test-mq-qrefresh.out
301 lines | 4.2 KiB | text/plain | TextLexer
/ tests / test-mq-qrefresh.out
% init
% commit
adding 1/base
adding 2/base
% qnew mqbase
% qrefresh
% qdiff
diff -r b55ecdccb5cf 1/base
--- a/1/base
+++ b/1/base
@@ -1,1 +1,1 @@
-base
+patched
diff -r b55ecdccb5cf 2/base
--- a/2/base
+++ b/2/base
@@ -1,1 +1,1 @@
-base
+patched
% qdiff dirname
diff -r b55ecdccb5cf 1/base
--- a/1/base
+++ b/1/base
@@ -1,1 +1,1 @@
-base
+patched
diff -r b55ecdccb5cf 2/base
--- a/2/base
+++ b/2/base
@@ -1,1 +1,1 @@
-base
+patched
% patch file contents
# HG changeset patch
# Parent
mqbase
diff -r b55ecdccb5cf 1/base
--- a/1/base
+++ b/1/base
@@ -1,1 +1,1 @@
-base
+patched
diff -r b55ecdccb5cf 2/base
--- a/2/base
+++ b/2/base
@@ -1,1 +1,1 @@
-base
+patched
% qrefresh 1
% qdiff
diff -r b55ecdccb5cf 1/base
--- a/1/base
+++ b/1/base
@@ -1,1 +1,1 @@
-base
+patched
diff -r b55ecdccb5cf 2/base
--- a/2/base
+++ b/2/base
@@ -1,1 +1,1 @@
-base
+patched
% qdiff dirname
diff -r b55ecdccb5cf 1/base
--- a/1/base
+++ b/1/base
@@ -1,1 +1,1 @@
-base
+patched
diff -r b55ecdccb5cf 2/base
--- a/2/base
+++ b/2/base
@@ -1,1 +1,1 @@
-base
+patched
% patch file contents
# HG changeset patch
# Parent
mqbase
diff -r b55ecdccb5cf 1/base
--- a/1/base
+++ b/1/base
@@ -1,1 +1,1 @@
-base
+patched
% qrefresh . in subdir
% qdiff
diff -r b55ecdccb5cf 1/base
--- a/1/base
+++ b/1/base
@@ -1,1 +1,1 @@
-base
+patched
diff -r b55ecdccb5cf 2/base
--- a/2/base
+++ b/2/base
@@ -1,1 +1,1 @@
-base
+patched
% qdiff dirname
diff -r b55ecdccb5cf 1/base
--- a/1/base
+++ b/1/base
@@ -1,1 +1,1 @@
-base
+patched
diff -r b55ecdccb5cf 2/base
--- a/2/base
+++ b/2/base
@@ -1,1 +1,1 @@
-base
+patched
% patch file contents
# HG changeset patch
# Parent
mqbase
diff -r b55ecdccb5cf 1/base
--- a/1/base
+++ b/1/base
@@ -1,1 +1,1 @@
-base
+patched
% qrefresh in hg-root again
% qdiff
diff -r b55ecdccb5cf 1/base
--- a/1/base
+++ b/1/base
@@ -1,1 +1,1 @@
-base
+patched
diff -r b55ecdccb5cf 2/base
--- a/2/base
+++ b/2/base
@@ -1,1 +1,1 @@
-base
+patched
% qdiff dirname
diff -r b55ecdccb5cf 1/base
--- a/1/base
+++ b/1/base
@@ -1,1 +1,1 @@
-base
+patched
diff -r b55ecdccb5cf 2/base
--- a/2/base
+++ b/2/base
@@ -1,1 +1,1 @@
-base
+patched
% patch file contents
# HG changeset patch
# Parent
mqbase
diff -r b55ecdccb5cf 1/base
--- a/1/base
+++ b/1/base
@@ -1,1 +1,1 @@
-base
+patched
diff -r b55ecdccb5cf 2/base
--- a/2/base
+++ b/2/base
@@ -1,1 +1,1 @@
-base
+patched
% qrefresh --short tests:
% - add 1/base and 2/base one by one
% -- qdiff output
diff -r b55ecdccb5cf 1/base
--- a/1/base
+++ b/1/base
@@ -1,1 +1,1 @@
-base
+patched
diff -r b55ecdccb5cf 2/base
--- a/2/base
+++ b/2/base
@@ -1,1 +1,1 @@
-base
+patched
diff -r b55ecdccb5cf orphanchild
--- /dev/null
+++ b/orphanchild
@@ -0,0 +1,1 @@
+orphan
% -- patch file content
# HG changeset patch
# Parent
mqbase
diff -r b55ecdccb5cf 1/base
--- a/1/base
+++ b/1/base
@@ -1,1 +1,1 @@
-base
+patched
diff -r b55ecdccb5cf 2/base
--- a/2/base
+++ b/2/base
@@ -1,1 +1,1 @@
-base
+patched
A orphanchild
? base
% -- diff shows what is not in patch
diff
--- /dev/null
+++ b/orphanchild
@@ -0,0 +1,1 @@
+orphan
% - before starting exclusive tests
1/base
2/base
% - exclude 2/base
1/base
% -- status shows 2/base as dirty
M 2/base
A orphanchild
? base
% - remove 1/base and add 2/base again but not orphanchild
2/base
% - add 1/base with include filter - and thus remove 2/base from patch
1/base
% create test repo
adding a
% capture changes
diff --git a/a b/ab
copy from a
copy to ab
--- a/a
+++ b/ab
@@ -1,1 +1,2 @@
a
+b
diff --git a/a b/ac
copy from a
copy to ac
--- a/a
+++ b/ac
@@ -1,1 +1,2 @@
a
+c
% refresh and check changes again
diff --git a/a b/ab
copy from a
copy to ab
--- a/a
+++ b/ab
@@ -1,1 +1,2 @@
a
+b
diff --git a/a b/ac
copy from a
copy to ac
--- a/a
+++ b/ac
@@ -1,1 +1,2 @@
a
+c
% issue1441 without git patches
diff -r 000000000000 b
--- /dev/null
+++ b/b
@@ -0,0 +1,1 @@
+a
% issue2025: qrefresh does not honor filtering options when tip != qtip
% refresh with tip != qtip
saving bundle...
adding branch
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
% status after refresh
M a
% b after refresh
b
b
% patch file after refresh
# HG changeset patch
# Parent
diff -r 1a60229be7ac b
--- a/b
+++ b/b
@@ -1,1 +1,2 @@
b
+b
% issue1441 with git patches
diff --git a/b b/b
new file mode 100644
--- /dev/null
+++ b/b
@@ -0,0 +1,1 @@
+a