##// END OF EJS Templates
outgoing: respect ":pushurl" paths (issue5365)...
Hollis Blanchard -
r35454:0ebd94ac default
parent child Browse files
Show More
@@ -916,8 +916,13 b' def incoming(ui, repo, source, opts):'
916 916 return _incoming(display, subreporecurse, ui, repo, source, opts)
917 917
918 918 def _outgoing(ui, repo, dest, opts):
919 dest = ui.expandpath(dest or 'default-push', dest or 'default')
920 dest, branches = parseurl(dest, opts.get('branch'))
919 path = ui.paths.getpath(dest, default=('default-push', 'default'))
920 if not path:
921 raise error.Abort(_('default repository not configured!'),
922 hint=_("see 'hg help config.paths'"))
923 dest = path.pushloc or path.loc
924 branches = path.branch, opts.get('branch') or []
925
921 926 ui.status(_('comparing with %s\n') % util.hidepassword(dest))
922 927 revs, checkout = addbranchrevs(repo, repo, branches, opts.get('rev'))
923 928 if revs:
@@ -1418,8 +1418,16 b' def outgoing(repo, subset, x):'
1418 1418 l = getargs(x, 0, 1, _("outgoing takes one or no arguments"))
1419 1419 # i18n: "outgoing" is a keyword
1420 1420 dest = l and getstring(l[0], _("outgoing requires a repository path")) or ''
1421 dest = repo.ui.expandpath(dest or 'default-push', dest or 'default')
1422 dest, branches = hg.parseurl(dest)
1421 if not dest:
1422 # ui.paths.getpath() explicitly tests for None, not just a boolean
1423 dest = None
1424 path = repo.ui.paths.getpath(dest, default=('default-push', 'default'))
1425 if not path:
1426 raise error.Abort(_('default repository not configured!'),
1427 hint=_("see 'hg help config.paths'"))
1428 dest = path.pushloc or path.loc
1429 branches = path.branch, []
1430
1423 1431 revs, checkout = hg.addbranchrevs(repo, repo, branches, [])
1424 1432 if revs:
1425 1433 revs = [repo.lookup(rev) for rev in revs]
@@ -491,3 +491,63 b' incoming from empty remote repository'
491 491 searching for changes
492 492 no changes found
493 493 [1]
494
495 Create a "split" repo that pulls from r1 and pushes to r2, using default-push
496
497 $ hg clone r1 split
498 updating to branch default
499 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
500 $ cat > split/.hg/hgrc << EOF
501 > [paths]
502 > default = $TESTTMP/r3
503 > default-push = $TESTTMP/r2
504 > EOF
505 $ hg -R split outgoing
506 comparing with $TESTTMP/r2
507 searching for changes
508 changeset: 0:3e92d79f743a
509 tag: tip
510 user: test
511 date: Thu Jan 01 00:00:00 1970 +0000
512 summary: a
513
514
515 Use default:pushurl instead of default-push
516
517 Windows needs a leading slash to make a URL that passes all of the checks
518 $ WD=`pwd`
519 #if windows
520 $ WD="/$WD"
521 #endif
522 $ cat > split/.hg/hgrc << EOF
523 > [paths]
524 > default = $WD/r3
525 > default:pushurl = file://$WD/r2
526 > EOF
527 $ hg -R split outgoing
528 comparing with file:/*/$TESTTMP/r2 (glob)
529 searching for changes
530 changeset: 0:3e92d79f743a
531 tag: tip
532 user: test
533 date: Thu Jan 01 00:00:00 1970 +0000
534 summary: a
535
536
537 Push and then double-check outgoing
538
539 $ echo a >> split/foo
540 $ hg -R split commit -Ama
541 $ hg -R split push
542 pushing to file:/*/$TESTTMP/r2 (glob)
543 searching for changes
544 adding changesets
545 adding manifests
546 adding file changes
547 added 2 changesets with 2 changes to 1 files
548 $ hg -R split outgoing
549 comparing with file:/*/$TESTTMP/r2 (glob)
550 searching for changes
551 no changes found
552 [1]
553
@@ -105,12 +105,11 b''
105 105 green = ../a#default
106 106
107 107 $ hg tout green
108 comparing with green
109 abort: repository green not found!
108 abort: repository green does not exist!
110 109 [255]
111 110
112 111 $ hg tlog -r 'outgoing("green")'
113 abort: repository green not found!
112 abort: repository green does not exist!
114 113 [255]
115 114
116 115 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now