sapling/tests/test-fb-hgext-dirsync-amend.t
Jun Wu 8c4a52d608 config: enable obsstore by default
Summary:
This makes tests closer to production setup and removes a bunch of "saved
backup bundle to ..." messages.

With D9236657, this should not hurt server-side performance.

Unfortunately a lot tests cannot be migrated easily, mostly because revision
numbers are used. They are left with a TODO.

Reviewed By: DurhamG

Differential Revision: D9237694

fbshipit-source-id: c993fce18f07aba09f6d70964e248af8d501575a
2018-10-26 18:54:40 -07:00

237 lines
4.5 KiB
Raku

$ cat >> $HGRCPATH << EOF
> [extensions]
> dirsync=
> EOF
$ hg init repo
$ cd repo
$ cat >> .hg/hgrc <<EOF
> [ui]
> verbose=true
> [dirsync]
> sync1.1=dir1/
> sync1.2=dir2/subdir/
> EOF
Add multiple files
$ mkdir dir1
$ echo a > dir1/a
$ echo b > dir1/b
$ hg commit -Am "Adding a and b"
adding dir1/a
adding dir1/b
mirrored adding 'dir1/a' to 'dir2/subdir/a'
mirrored adding 'dir1/b' to 'dir2/subdir/b'
committing files:
dir1/a
dir1/b
dir2/subdir/a
dir2/subdir/b
committing manifest
committing changelog
committed changeset 0:32bc2a06fd26
$ hg diff --git -r null -r .
diff --git a/dir1/a b/dir1/a
new file mode 100644
--- /dev/null
+++ b/dir1/a
@@ -0,0 +1,1 @@
+a
diff --git a/dir1/b b/dir1/b
new file mode 100644
--- /dev/null
+++ b/dir1/b
@@ -0,0 +1,1 @@
+b
diff --git a/dir2/subdir/a b/dir2/subdir/a
new file mode 100644
--- /dev/null
+++ b/dir2/subdir/a
@@ -0,0 +1,1 @@
+a
diff --git a/dir2/subdir/b b/dir2/subdir/b
new file mode 100644
--- /dev/null
+++ b/dir2/subdir/b
@@ -0,0 +1,1 @@
+b
Include only changes to particular file
$ echo a >> dir1/a
$ echo b >> dir1/b
$ hg commit --amend -I dir1/a
mirrored changes in 'dir1/a' to 'dir2/subdir/a'
amending changeset 32bc2a06fd26
committing files:
dir1/a
dir1/b
dir2/subdir/a
dir2/subdir/b
committing manifest
committing changelog
committed changeset 1:e9cce3b53a7c
$ hg diff --git -r null -r .
diff --git a/dir1/a b/dir1/a
new file mode 100644
--- /dev/null
+++ b/dir1/a
@@ -0,0 +1,2 @@
+a
+a
diff --git a/dir1/b b/dir1/b
new file mode 100644
--- /dev/null
+++ b/dir1/b
@@ -0,0 +1,1 @@
+b
diff --git a/dir2/subdir/a b/dir2/subdir/a
new file mode 100644
--- /dev/null
+++ b/dir2/subdir/a
@@ -0,0 +1,2 @@
+a
+a
diff --git a/dir2/subdir/b b/dir2/subdir/b
new file mode 100644
--- /dev/null
+++ b/dir2/subdir/b
@@ -0,0 +1,1 @@
+b
$ echo a >> dir1/a
$ hg commit --amend dir1/b
mirrored changes in 'dir1/b' to 'dir2/subdir/b'
amending changeset e9cce3b53a7c
committing files:
dir1/a
dir1/b
dir2/subdir/a
dir2/subdir/b
committing manifest
committing changelog
committed changeset 2:a70e8a6cacdd
$ hg diff --git -r null -r .
diff --git a/dir1/a b/dir1/a
new file mode 100644
--- /dev/null
+++ b/dir1/a
@@ -0,0 +1,2 @@
+a
+a
diff --git a/dir1/b b/dir1/b
new file mode 100644
--- /dev/null
+++ b/dir1/b
@@ -0,0 +1,2 @@
+b
+b
diff --git a/dir2/subdir/a b/dir2/subdir/a
new file mode 100644
--- /dev/null
+++ b/dir2/subdir/a
@@ -0,0 +1,2 @@
+a
+a
diff --git a/dir2/subdir/b b/dir2/subdir/b
new file mode 100644
--- /dev/null
+++ b/dir2/subdir/b
@@ -0,0 +1,2 @@
+b
+b
Exclude changes to particular file
$ echo b >> dir1/b
$ hg commit --amend -X dir1/a
mirrored changes in 'dir1/b' to 'dir2/subdir/b'
amending changeset a70e8a6cacdd
committing files:
dir1/a
dir1/b
dir2/subdir/a
dir2/subdir/b
committing manifest
committing changelog
committed changeset 3:4af805a433df
$ hg diff --git -r null -r .
diff --git a/dir1/a b/dir1/a
new file mode 100644
--- /dev/null
+++ b/dir1/a
@@ -0,0 +1,2 @@
+a
+a
diff --git a/dir1/b b/dir1/b
new file mode 100644
--- /dev/null
+++ b/dir1/b
@@ -0,0 +1,3 @@
+b
+b
+b
diff --git a/dir2/subdir/a b/dir2/subdir/a
new file mode 100644
--- /dev/null
+++ b/dir2/subdir/a
@@ -0,0 +1,2 @@
+a
+a
diff --git a/dir2/subdir/b b/dir2/subdir/b
new file mode 100644
--- /dev/null
+++ b/dir2/subdir/b
@@ -0,0 +1,3 @@
+b
+b
+b
Check the addremove flag
$ echo c > dir1/c
$ rm dir1/a
$ hg commit --amend -A
removing dir1/a
adding dir1/c
mirrored adding 'dir1/c' to 'dir2/subdir/c'
mirrored remove of 'dir1/a' to 'dir2/subdir/a'
amending changeset 4af805a433df
committing files:
dir1/b
dir1/c
dir2/subdir/b
dir2/subdir/c
committing manifest
committing changelog
committed changeset 4:55c6a18e7d57
$ hg diff --git -r null -r .
diff --git a/dir1/b b/dir1/b
new file mode 100644
--- /dev/null
+++ b/dir1/b
@@ -0,0 +1,3 @@
+b
+b
+b
diff --git a/dir1/c b/dir1/c
new file mode 100644
--- /dev/null
+++ b/dir1/c
@@ -0,0 +1,1 @@
+c
diff --git a/dir2/subdir/b b/dir2/subdir/b
new file mode 100644
--- /dev/null
+++ b/dir2/subdir/b
@@ -0,0 +1,3 @@
+b
+b
+b
diff --git a/dir2/subdir/c b/dir2/subdir/c
new file mode 100644
--- /dev/null
+++ b/dir2/subdir/c
@@ -0,0 +1,1 @@
+c