##// END OF EJS Templates
flagutil: move addflagprocessor to the new module (API)
flagutil: move addflagprocessor to the new module (API)

File last commit:

r42530:d8e55c0c default
r42958:6d61be15 default
Show More
test-origbackup-conflict.t
137 lines | 3.4 KiB | text/troff | Tads3Lexer
/ tests / test-origbackup-conflict.t
Mark Thomas
scmutil: handle conflicting files and dirs in origbackuppath...
r34544 Set up repo
$ cat << EOF >> $HGRCPATH
> [ui]
> origbackuppath=.hg/origbackups
> [merge]
> checkunknown=warn
> EOF
$ hg init repo
$ cd repo
$ echo base > base
$ hg add base
$ hg commit -m "base"
Mark Thomas
tests: add a test demonstrating issue5731...
r35007 Make a dir named b that contains a file, and a file named d
Mark Thomas
scmutil: handle conflicting files and dirs in origbackuppath...
r34544
$ mkdir -p b
$ echo c1 > b/c
Mark Thomas
tests: add a test demonstrating issue5731...
r35007 $ echo d1 > d
$ hg add b/c d
Mark Thomas
scmutil: handle conflicting files and dirs in origbackuppath...
r34544 $ hg commit -m "c1"
$ hg bookmark c1
Peform an update that causes b/c to be backed up
$ hg up -q 0
$ mkdir -p b
$ echo c2 > b/c
$ hg up --verbose c1
resolving manifests
b/c: replacing untracked file
getting b/c
Matt Harbison
tests: remove (glob) annotations that were only for '\' matches...
r35394 creating directory: $TESTTMP/repo/.hg/origbackups/b
Mark Thomas
tests: add a test demonstrating issue5731...
r35007 getting d
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
Mark Thomas
scmutil: handle conflicting files and dirs in origbackuppath...
r34544 (activating bookmark c1)
$ test -f .hg/origbackups/b/c
Mark Thomas
tests: add a test demonstrating issue5731...
r35007 Make files named b and d
Mark Thomas
scmutil: handle conflicting files and dirs in origbackuppath...
r34544
$ hg up -q 0
$ echo b1 > b
Mark Thomas
tests: add a test demonstrating issue5731...
r35007 $ echo d2 > d
$ hg add b d
Mark Thomas
scmutil: handle conflicting files and dirs in origbackuppath...
r34544 $ hg commit -m b1
created new head
$ hg bookmark b1
Perform an update that causes b to be backed up - it should replace the backup b dir
$ hg up -q 0
$ echo b2 > b
$ hg up --verbose b1
resolving manifests
b: replacing untracked file
getting b
Matt Harbison
tests: remove (glob) annotations that were only for '\' matches...
r35394 removing conflicting directory: $TESTTMP/repo/.hg/origbackups/b
Mark Thomas
tests: add a test demonstrating issue5731...
r35007 getting d
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
Mark Thomas
scmutil: handle conflicting files and dirs in origbackuppath...
r34544 (activating bookmark b1)
$ test -f .hg/origbackups/b
Perform an update the causes b/c to be backed up again - it should replace the backup b file
$ hg up -q 0
$ mkdir b
$ echo c3 > b/c
$ hg up --verbose c1
resolving manifests
b/c: replacing untracked file
getting b/c
Matt Harbison
tests: remove (glob) annotations that were only for '\' matches...
r35394 creating directory: $TESTTMP/repo/.hg/origbackups/b
removing conflicting file: $TESTTMP/repo/.hg/origbackups/b
Mark Thomas
tests: add a test demonstrating issue5731...
r35007 getting d
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
Mark Thomas
scmutil: handle conflicting files and dirs in origbackuppath...
r34544 (activating bookmark c1)
$ test -d .hg/origbackups/b
Mark Thomas
tests: add a test demonstrating issue5731...
r35007 Cause two symlinks to be backed up that points to a valid location from the backup dir
Mark Thomas
scmutil: handle conflicting files and dirs in origbackuppath...
r34544
$ hg up -q 0
$ mkdir ../sym-link-target
Matt Harbison
test-conflicts: conditionalize for no-symlink platforms...
r34692 #if symlink
Mark Thomas
scmutil: handle conflicting files and dirs in origbackuppath...
r34544 $ ln -s ../../../sym-link-target b
Mark Thomas
tests: add a test demonstrating issue5731...
r35007 $ ln -s ../../../sym-link-target d
Matt Harbison
test-conflicts: conditionalize for no-symlink platforms...
r34692 #else
Mark Thomas
tests: add a test demonstrating issue5731...
r35007 $ touch b d
Matt Harbison
test-conflicts: conditionalize for no-symlink platforms...
r34692 #endif
Mark Thomas
scmutil: handle conflicting files and dirs in origbackuppath...
r34544 $ hg up b1
b: replacing untracked file
Mark Thomas
tests: add a test demonstrating issue5731...
r35007 d: replacing untracked file
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
Mark Thomas
scmutil: handle conflicting files and dirs in origbackuppath...
r34544 (activating bookmark b1)
Matt Harbison
test-conflicts: conditionalize for no-symlink platforms...
r34692 #if symlink
Augie Fackler
tests: use readlink.py instead of readlink...
r34571 $ readlink.py .hg/origbackups/b
.hg/origbackups/b -> ../../../sym-link-target
Matt Harbison
test-conflicts: conditionalize for no-symlink platforms...
r34692 #endif
Mark Thomas
scmutil: handle conflicting files and dirs in origbackuppath...
r34544
Mark Thomas
tests: add a test demonstrating issue5731...
r35007 Perform an update that causes b/c and d to be backed up again - b/c should not go into the target dir
Mark Thomas
scmutil: handle conflicting files and dirs in origbackuppath...
r34544
$ hg up -q 0
$ mkdir b
$ echo c4 > b/c
Mark Thomas
tests: add a test demonstrating issue5731...
r35007 $ echo d3 > d
Mark Thomas
scmutil: handle conflicting files and dirs in origbackuppath...
r34544 $ hg up --verbose c1
resolving manifests
b/c: replacing untracked file
Mark Thomas
tests: add a test demonstrating issue5731...
r35007 d: replacing untracked file
Mark Thomas
scmutil: handle conflicting files and dirs in origbackuppath...
r34544 getting b/c
Matt Harbison
tests: remove (glob) annotations that were only for '\' matches...
r35394 creating directory: $TESTTMP/repo/.hg/origbackups/b
removing conflicting file: $TESTTMP/repo/.hg/origbackups/b
Mark Thomas
tests: add a test demonstrating issue5731...
r35007 getting d
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
Mark Thomas
scmutil: handle conflicting files and dirs in origbackuppath...
r34544 (activating bookmark c1)
$ cat .hg/origbackups/b/c
c4
Mark Thomas
scmutil: don't try to delete origbackup symlinks to directories (issue5731)...
r35008 $ cat .hg/origbackups/d
d3
Mark Thomas
scmutil: handle conflicting files and dirs in origbackuppath...
r34544 $ ls ../sym-link-target
Incorrectly configure origbackuppath to be under a file
$ echo data > .hg/badorigbackups
$ hg up -q 0
$ mkdir b
$ echo c5 > b/c
$ hg up --verbose c1 --config ui.origbackuppath=.hg/badorigbackups
resolving manifests
b/c: replacing untracked file
getting b/c
Matt Harbison
tests: remove (glob) annotations that were only for '\' matches...
r35394 creating directory: $TESTTMP/repo/.hg/badorigbackups/b
Martin von Zweigbergk
util: make util.dirs() and util.finddirs() include root directory (API)...
r42530 removing conflicting file: $TESTTMP/repo/.hg/badorigbackups
getting d
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
(activating bookmark c1)
$ ls .hg/badorigbackups/b
c