##// END OF EJS Templates
transplant: use peer of source repository as "remote" for "repo.pull()"...
transplant: use peer of source repository as "remote" for "repo.pull()" Before this patch, transplant with "--merge" option fails with traceback unexpectedly, if it causes pull from the source repository on the local host. "discovery.findcommonincoming()" invokes "capable()" method on the object given from "localrepository.pull()", but it is "localrepository" object in this case and doesn't have such method. This patch uses peer object of source repository as "remote" argument for "localrepository.pull()" invocation like other invocations of it in transplant.py.

File last commit:

r19129:bd19587a stable
r20020:6fb59247 default
Show More
test-revert.t
302 lines | 4.7 KiB | text/troff | Tads3Lexer
Nicolas Dumazet
tests: unify test-revert
r12106 $ hg init repo
$ cd repo
$ echo 123 > a
$ echo 123 > c
$ echo 123 > e
$ hg add a c e
Martin Geisler
tests: remove unneeded -d flags...
r12156 $ hg commit -m "first" a c e
Adrian Buehlmann
test-revert: add case for nothing changed
r14745
nothing changed
$ hg revert
abort: no files or directories specified
Adrian Buehlmann
revert: improve hints on abort when reverting to parent without --all...
r14755 (use --all to revert all files)
Adrian Buehlmann
test-revert: add case for nothing changed
r14745 [255]
Adrian Buehlmann
test-revert: add revert --all case when nothing changed...
r14767 $ hg revert --all
Adrian Buehlmann
test-revert: add case for nothing changed
r14745
Nicolas Dumazet
tests: unify test-revert
r12106 $ echo 123 > b
should show b unknown
$ hg status
? b
$ echo 12 > c
should show b unknown and c modified
$ hg status
M c
? b
$ hg add b
should show b added and c modified
$ hg status
M c
A b
$ hg rm a
should show a removed, b added and c modified
$ hg status
M c
A b
R a
$ hg revert a
should show b added, copy saved, and c modified
$ hg status
M c
A b
$ hg revert b
should show b unknown, and c modified
$ hg status
M c
? b
$ hg revert --no-backup c
should show unknown: b
$ hg status
? b
$ hg add b
should show b added
$ hg status b
A b
$ rm b
should show b deleted
$ hg status b
! b
$ hg revert -v b
forgetting b
should not find b
$ hg status b
Mads Kiilerich
tests: hide 'No such file or directory' messages...
r15521 b: * (glob)
Nicolas Dumazet
tests: unify test-revert
r12106
should show a c e
$ ls
a
c
e
should verbosely save backup to e.orig
$ echo z > e
$ hg revert --all -v
saving current version of e as e.orig
reverting e
should say no changes needed
$ hg revert a
no changes needed to a
should say file not managed
$ echo q > q
$ hg revert q
file not managed: q
$ rm q
should say file not found
$ hg revert notfound
Martin Geisler
tests: remove unneeded -d flags...
r12156 notfound: no such file in rev 334a9e57682c
Nicolas Dumazet
tests: unify test-revert
r12106 $ touch d
$ hg add d
$ hg rm a
Martin Geisler
tests: remove unneeded -d flags...
r12156 $ hg commit -m "second"
Nicolas Dumazet
tests: unify test-revert
r12106 $ echo z > z
$ hg add z
$ hg st
A z
? e.orig
should add a, remove d, forget z
$ hg revert --all -r0
adding a
removing d
forgetting z
should forget a, undelete d
$ hg revert --all -rtip
forgetting a
undeleting d
$ rm a *.orig
should silently add a
$ hg revert -r0 a
$ hg st a
A a
$ hg rm d
$ hg st d
R d
should silently keep d removed
$ hg revert -r0 d
$ hg st d
R d
$ hg update -C
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
Adrian Buehlmann
test-revert: enable for Windows
r16886 #if execbit
Nicolas Dumazet
tests: unify test-revert
r12106 $ chmod +x c
$ hg revert --all
reverting c
should print non-executable
$ test -x c || echo non-executable
non-executable
$ chmod +x c
Martin Geisler
tests: remove unneeded -d flags...
r12156 $ hg commit -m exe
Nicolas Dumazet
tests: unify test-revert
r12106
$ chmod -x c
$ hg revert --all
reverting c
should print executable
$ test -x c && echo executable
executable
Adrian Buehlmann
test-revert: enable for Windows
r16886 #endif
Nicolas Dumazet
tests: unify test-revert
r12106
$ cd ..
Martin Geisler
tests: added a short description to issue numbers...
r12399 Issue241: update and revert produces inconsistent repositories
Nicolas Dumazet
tests: unify test-revert
r12106
$ hg init a
$ cd a
$ echo a >> a
$ hg commit -A -d '1 0' -m a
adding a
$ echo a >> a
$ hg commit -d '2 0' -m a
$ hg update 0
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ mkdir b
$ echo b > b/b
should fail - no arguments
$ hg revert -rtip
Matt Mackall
revert: drop requirement to use -r to revert with two parents...
r14542 abort: no files or directories specified
Adrian Buehlmann
revert: mention update in hint of abort when reverting to non-parent...
r14726 (use --all to revert all files, or 'hg update 1' to update)
Matt Mackall
tests: add exit codes to unified tests
r12316 [255]
Nicolas Dumazet
tests: unify test-revert
r12106
should succeed
$ hg revert --all -rtip
reverting a
Martin Geisler
tests: added a short description to issue numbers...
r12399 Issue332: confusing message when reverting directory
Nicolas Dumazet
tests: unify test-revert
r12106
Martin Geisler
tests: remove unneeded -d flags...
r12156 $ hg ci -A -m b
Nicolas Dumazet
tests: unify test-revert
r12106 adding b/b
created new head
$ echo foobar > b/b
$ mkdir newdir
$ echo foo > newdir/newfile
$ hg add newdir/newfile
$ hg revert b newdir
Mads Kiilerich
tests: make (glob) on windows accept \ instead of /...
r15447 reverting b/b (glob)
forgetting newdir/newfile (glob)
Nicolas Dumazet
tests: unify test-revert
r12106 $ echo foobar > b/b
$ hg revert .
Mads Kiilerich
tests: make (glob) on windows accept \ instead of /...
r15447 reverting b/b (glob)
Nicolas Dumazet
tests: unify test-revert
r12106
reverting a rename target should revert the source
$ hg mv a newa
$ hg revert newa
$ hg st a newa
? newa
$ cd ..
$ hg init ignored
$ cd ignored
$ echo '^ignored$' > .hgignore
$ echo '^ignoreddir$' >> .hgignore
$ echo '^removed$' >> .hgignore
$ mkdir ignoreddir
$ touch ignoreddir/file
$ touch ignoreddir/removed
$ touch ignored
$ touch removed
4 ignored files (we will add/commit everything)
$ hg st -A -X .hgignore
I ignored
I ignoreddir/file
I ignoreddir/removed
I removed
$ hg ci -qAm 'add files' ignored ignoreddir/file ignoreddir/removed removed
$ echo >> ignored
$ echo >> ignoreddir/file
$ hg rm removed ignoreddir/removed
should revert ignored* and undelete *removed
$ hg revert -a --no-backup
reverting ignored
Mads Kiilerich
tests: make (glob) on windows accept \ instead of /...
r15447 reverting ignoreddir/file (glob)
undeleting ignoreddir/removed (glob)
Nicolas Dumazet
tests: unify test-revert
r12106 undeleting removed
$ hg st -mardi
$ hg up -qC
$ echo >> ignored
$ hg rm removed
should silently revert the named files
$ hg revert --no-backup ignored removed
$ hg st -mardi
Mads Kiilerich
tests: add missing trailing 'cd ..'...
r16913
Bryan O'Sullivan
revert: ensure that copies and renames are honored (issue3920)...
r19129 someone set up us the copies
$ rm .hgignore
$ hg update -C
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg mv ignored allyour
$ hg copy removed base
$ hg commit -m rename
copies and renames, you have no chance to survive make your time (issue3920)
$ hg update '.^'
1 files updated, 0 files merged, 2 files removed, 0 files unresolved
$ hg revert -rtip -a
adding allyour
adding base
removing ignored
$ hg status -C
A allyour
ignored
A base
removed
R ignored
Mads Kiilerich
tests: add missing trailing 'cd ..'...
r16913 $ cd ..