##// END OF EJS Templates
ui: pass a `ui` object to `paths.getpath`...
ui: pass a `ui` object to `paths.getpath` I want to introduce more path's suboption and make it possible to use default value for them. Processing theses sub-options might result in warnings. We need a `ui` object to issue such warnings. To make things simpler, we add an helper method on the `ui` object. Differential Revision: https://phab.mercurial-scm.org/D10162

File last commit:

r46518:95c4cca6 default
r47454:66fb0455 default
Show More
test-default-push.t
149 lines | 3.5 KiB | text/troff | Tads3Lexer
/ tests / test-default-push.t
Adrian Buehlmann
tests: unify test-default-push
r12287 $ hg init a
$ echo a > a/a
$ hg --cwd a ci -Ama
adding a
$ hg clone a c
updating to branch default
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg clone a b
updating to branch default
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ echo b >> b/a
$ hg --cwd b ci -mb
anuraggoel
push: provide a hint when no paths in configured (issue3692)...
r20558 Push should provide a hint when both 'default' and 'default-push' not set:
$ cd c
$ hg push --config paths.default=
Martin von Zweigbergk
errors: raise ConfigError on failure to parse config file...
r46506 config error: default repository not configured!
timeless
push: update help hint to point to config.paths section
r29965 (see 'hg help config.paths')
Martin von Zweigbergk
errors: raise more specific errors when default remote not configured...
r46446 [30]
anuraggoel
push: provide a hint when no paths in configured (issue3692)...
r20558
$ cd ..
Adrian Buehlmann
tests: unify test-default-push
r12287 Push should push to 'default' when 'default-push' not set:
$ hg --cwd b push
Matt Harbison
tests: remove (glob) annotations that were only for '\' matches...
r35394 pushing to $TESTTMP/a
Adrian Buehlmann
tests: unify test-default-push
r12287 searching for changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
Push should push to 'default-push' when set:
Jordi Gutiérrez Hermoso
config: use the same hgrc for a cloned repo as for an uninitted repo...
r22837 $ echo '[paths]' >> b/.hg/hgrc
Adrian Buehlmann
tests: unify test-default-push
r12287 $ echo 'default-push = ../c' >> b/.hg/hgrc
$ hg --cwd b push
Matt Harbison
tests: remove (glob) annotations that were only for '\' matches...
r35394 pushing to $TESTTMP/c
Adrian Buehlmann
tests: unify test-default-push
r12287 searching for changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
Gregory Szorc
ui: change default path fallback mechanism (issue4796)...
r26189
Yuya Nishihara
push: restore old behavior of default-push (issue5000)...
r27555 But push should push to 'default' if explicitly specified (issue5000):
$ hg --cwd b push default
Matt Harbison
tests: remove (glob) annotations that were only for '\' matches...
r35394 pushing to $TESTTMP/a
Yuya Nishihara
push: restore old behavior of default-push (issue5000)...
r27555 searching for changes
no changes found
[1]
Gregory Szorc
ui: support paths.default-push without paths.default set (issue4914)...
r26820 Push should push to 'default-push' when 'default' is not set
$ hg -q clone a push-default-only
$ cd push-default-only
$ rm .hg/hgrc
$ touch foo
$ hg -q commit -A -m 'add foo'
$ hg --config paths.default-push=../a push
Matt Harbison
tests: remove (glob) annotations that were only for '\' matches...
r35394 pushing to $TESTTMP/a
Gregory Szorc
ui: support paths.default-push without paths.default set (issue4914)...
r26820 searching for changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
$ cd ..
Gregory Szorc
ui: change default path fallback mechanism (issue4796)...
r26189 Pushing to a path that isn't defined should not fall back to default
$ hg --cwd b push doesnotexist
Martin von Zweigbergk
errors: remove trailing "!" from some error messages for consistency...
r46518 abort: repository doesnotexist does not exist
Gregory Szorc
ui: change default path fallback mechanism (issue4796)...
r26189 [255]
Gregory Szorc
ui: support declaring path push urls as sub-options...
r27266
:pushurl is used when defined
$ hg -q clone a pushurlsource
$ hg -q clone a pushurldest
$ cd pushurlsource
Matt Harbison
tests: make `pwd` URL compatible on Windows in test-default-push...
r27437
Windows needs a leading slash to make a URL that passes all of the checks
$ WD=`pwd`
#if windows
$ WD="/$WD"
#endif
Gregory Szorc
ui: support declaring path push urls as sub-options...
r27266 $ cat > .hg/hgrc << EOF
> [paths]
> default = https://example.com/not/relevant
Matt Harbison
tests: make `pwd` URL compatible on Windows in test-default-push...
r27437 > default:pushurl = file://$WD/../pushurldest
Gregory Szorc
ui: support declaring path push urls as sub-options...
r27266 > EOF
$ touch pushurl
$ hg -q commit -A -m 'add pushurl'
$ hg push
pushing to file:/*/$TESTTMP/pushurlsource/../pushurldest (glob)
searching for changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
Gregory Szorc
ui: path option to declare which revisions to push by default...
r29413 :pushrev is used when no -r is passed
$ cat >> .hg/hgrc << EOF
> default:pushrev = .
> EOF
$ hg -q up -r 0
$ echo head1 > foo
$ hg -q commit -A -m head1
$ hg -q up -r 0
$ echo head2 > foo
$ hg -q commit -A -m head2
$ hg push -f
pushing to file:/*/$TESTTMP/pushurlsource/../pushurldest (glob)
searching for changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files (+1 heads)
$ hg --config 'paths.default:pushrev=draft()' push -f
pushing to file:/*/$TESTTMP/pushurlsource/../pushurldest (glob)
searching for changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files (+1 heads)
Invalid :pushrev raises appropriately
$ hg --config 'paths.default:pushrev=notdefined()' push
pushing to file:/*/$TESTTMP/pushurlsource/../pushurldest (glob)
hg: parse error: unknown identifier: notdefined
Martin von Zweigbergk
errors: use exit code 10 for parse errors...
r46507 [10]
Gregory Szorc
ui: path option to declare which revisions to push by default...
r29413
$ hg --config 'paths.default:pushrev=(' push
pushing to file:/*/$TESTTMP/pushurlsource/../pushurldest (glob)
hg: parse error at 1: not a prefix: end
Ryan McElroy
revsetlang: add a hint for more useful parse errors...
r36703 ((
^ here)
Martin von Zweigbergk
errors: use exit code 10 for parse errors...
r46507 [10]
Gregory Szorc
ui: path option to declare which revisions to push by default...
r29413
Gregory Szorc
ui: support declaring path push urls as sub-options...
r27266 $ cd ..