##// END OF EJS Templates
revset: fix #branch in urls for outgoing()...
Adrian Buehlmann -
r12614:f314723f stable
parent child Browse files
Show More
@@ -0,0 +1,92 b''
1 $ cat >> $HGRCPATH <<EOF
2 > [extensions]
3 > graphlog=
4 >
5 > [alias]
6 > tlog = log --template "{rev}:{node|short}: '{desc}' {branches}\n"
7 > tglog = tlog -G
8 > tout = out --template "{rev}:{node|short}: '{desc}' {branches}\n"
9 > EOF
10
11 $ hg init a
12 $ cd a
13
14 $ echo a > a
15 $ hg ci -Aqm0
16
17 $ echo foo >> a
18 $ hg ci -Aqm1
19
20 $ hg up -q 0
21
22 $ hg branch stable
23 marked working directory as branch stable
24 $ echo bar >> a
25 $ hg ci -qm2
26
27 $ hg tglog
28 @ 2:7bee6c3bea3a: '2' stable
29 |
30 | o 1:3560197d8331: '1'
31 |/
32 o 0:f7b1eb17ad24: '0'
33
34
35 $ cd ..
36
37 $ hg clone -q a#stable b
38
39 $ cd b
40 $ cat .hg/hgrc
41 [paths]
42 default = */a#stable (glob)
43
44 $ echo red >> a
45 $ hg ci -qm3
46
47 $ hg up -q default
48
49 $ echo blue >> a
50 $ hg ci -qm4
51
52 $ hg tglog
53 @ 3:f0461977a3db: '4'
54 |
55 | o 2:1d4099801a4e: '3' stable
56 | |
57 | o 1:7bee6c3bea3a: '2' stable
58 |/
59 o 0:f7b1eb17ad24: '0'
60
61
62 $ hg tout
63 comparing with */a (glob)
64 searching for changes
65 2:1d4099801a4e: '3' stable
66
67 $ hg tlog -r 'outgoing()'
68 2:1d4099801a4e: '3' stable
69
70 $ hg tout ../a#default
71 comparing with ../a
72 searching for changes
73 3:f0461977a3db: '4'
74
75 $ hg tlog -r 'outgoing("../a#default")'
76 3:f0461977a3db: '4'
77
78 $ echo "green = ../a#default" >> .hg/hgrc
79
80 $ cat .hg/hgrc
81 [paths]
82 default = */a#stable (glob)
83 green = ../a#default
84
85 $ hg tout green
86 comparing with */a (glob)
87 searching for changes
88 3:f0461977a3db: '4'
89
90 $ hg tlog -r 'outgoing("green")'
91 3:f0461977a3db: '4'
92
@@ -435,12 +435,15 b' def outgoing(repo, subset, x):'
435 dest = l and getstring(l[0], _("outgoing wants a repository path")) or ''
435 dest = l and getstring(l[0], _("outgoing wants a repository path")) or ''
436 dest = repo.ui.expandpath(dest or 'default-push', dest or 'default')
436 dest = repo.ui.expandpath(dest or 'default-push', dest or 'default')
437 dest, branches = hg.parseurl(dest)
437 dest, branches = hg.parseurl(dest)
438 revs, checkout = hg.addbranchrevs(repo, repo, branches, [])
439 if revs:
440 revs = [repo.lookup(rev) for rev in revs]
438 other = hg.repository(hg.remoteui(repo, {}), dest)
441 other = hg.repository(hg.remoteui(repo, {}), dest)
439 repo.ui.pushbuffer()
442 repo.ui.pushbuffer()
440 o = discovery.findoutgoing(repo, other)
443 o = discovery.findoutgoing(repo, other)
441 repo.ui.popbuffer()
444 repo.ui.popbuffer()
442 cl = repo.changelog
445 cl = repo.changelog
443 o = set([cl.rev(r) for r in repo.changelog.nodesbetween(o, None)[0]])
446 o = set([cl.rev(r) for r in repo.changelog.nodesbetween(o, revs)[0]])
444 return [r for r in subset if r in o]
447 return [r for r in subset if r in o]
445
448
446 def tagged(repo, subset, x):
449 def tagged(repo, subset, x):
General Comments 0
You need to be logged in to leave comments. Login now