tests/test-revset-outgoing.t
author Matt Harbison <matt_harbison@yahoo.com>
Sun, 22 Jul 2012 23:37:53 -0400
branchstable
changeset 17245 6e84171a61c8
parent 16913 f2719b387380
child 20117 aa9385f983fa
permissions -rw-r--r--
largefiles: fix path handling for cp/mv (issue3516) Previously, a copy or a move of a largefile only worked if the cwd was the root of the repository. The first issue was that the destination path passed to os.mkdirs() chopped the absolute path to the standin after '.hglf/', which essentially created a path relative to the repository root. Similarly, the second issue was that the source and dest paths for copyfile() were relative to the repo root. This converts these three paths to absolute paths. Some notable issues, regardless of the directory in which the cp/mv is executed: 1) The copy is not being recorded in lfdirstate, but it is in dirstate for the standins. I'm not sure if this is by design (i.e. minimal info in lfdirstate). 2) status -C doesn't behave as expected. Using the testcase as an example: # after mv + ci $ hg status -C -v --rev '.^' # expected to see 'A' and ' ' lines too R dira\dirb\largefile $ hg status -C -v --rev '.^' foo/largefile # no output # expected to see 'A' and ' ' lines only $ hg status -C -v --rev '.^' foo/ # no output # expected to see 'A', ' ' and 'R' lines $ hg status -C -v --rev '.^' ./ # expected to see 'A' and ' ' lines too R dirb\largefile $ hg status -C -v --rev '.^' ../.hglf/dira/foo/largefile A ..\.hglf\dira\foo\largefile ..\.hglf\dira\dirb\largefile # no 'R' expected when new file is specified $ hg status -C -v --rev '.^' ../.hglf # OK A ..\.hglf\dira\foo\largefile ..\.hglf\dira\dirb\largefile R ..\.hglf\dira\dirb\largefile
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
12614
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
     1
  $ cat >> $HGRCPATH <<EOF
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
     2
  > [extensions]
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
     3
  > graphlog=
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
     4
  > 
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
     5
  > [alias]
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
     6
  > tlog = log --template "{rev}:{node|short}: '{desc}' {branches}\n"
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
     7
  > tglog = tlog -G
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
     8
  > tout = out --template "{rev}:{node|short}: '{desc}' {branches}\n"
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
     9
  > EOF
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    10
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    11
  $ hg init a
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    12
  $ cd a
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    13
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    14
  $ echo a > a
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    15
  $ hg ci -Aqm0
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    16
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    17
  $ echo foo >> a
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    18
  $ hg ci -Aqm1
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    19
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    20
  $ hg up -q 0
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    21
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    22
  $ hg branch stable
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    23
  marked working directory as branch stable
15615
41885892796e branch: warn on branching
Matt Mackall <mpm@selenic.com>
parents: 13572
diff changeset
    24
  (branches are permanent and global, did you want a bookmark?)
12614
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    25
  $ echo bar >> a
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    26
  $ hg ci -qm2
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    27
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    28
  $ hg tglog
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    29
  @  2:7bee6c3bea3a: '2' stable
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    30
  |
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    31
  | o  1:3560197d8331: '1'
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    32
  |/
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    33
  o  0:f7b1eb17ad24: '0'
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    34
  
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    35
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    36
  $ cd ..
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    37
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    38
  $ hg clone -q a#stable b
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    39
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    40
  $ cd b
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    41
  $ cat .hg/hgrc
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    42
  [paths]
15447
9910f60a37ee tests: make (glob) on windows accept \ instead of /
Mads Kiilerich <mads@kiilerich.com>
parents: 13572
diff changeset
    43
  default = $TESTTMP/a#stable (glob)
12614
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    44
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    45
  $ echo red >> a
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    46
  $ hg ci -qm3
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    47
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    48
  $ hg up -q default
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    49
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    50
  $ echo blue >> a
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    51
  $ hg ci -qm4
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    52
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    53
  $ hg tglog
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    54
  @  3:f0461977a3db: '4'
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    55
  |
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    56
  | o  2:1d4099801a4e: '3' stable
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    57
  | |
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    58
  | o  1:7bee6c3bea3a: '2' stable
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    59
  |/
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    60
  o  0:f7b1eb17ad24: '0'
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    61
  
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    62
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    63
  $ hg tout
15447
9910f60a37ee tests: make (glob) on windows accept \ instead of /
Mads Kiilerich <mads@kiilerich.com>
parents: 13572
diff changeset
    64
  comparing with $TESTTMP/a (glob)
12614
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    65
  searching for changes
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    66
  2:1d4099801a4e: '3' stable
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    67
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    68
  $ hg tlog -r 'outgoing()'
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    69
  2:1d4099801a4e: '3' stable
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    70
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    71
  $ hg tout ../a#default
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    72
  comparing with ../a
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    73
  searching for changes
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    74
  3:f0461977a3db: '4' 
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    75
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    76
  $ hg tlog -r 'outgoing("../a#default")'
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    77
  3:f0461977a3db: '4' 
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    78
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    79
  $ echo "green = ../a#default" >> .hg/hgrc
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    80
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    81
  $ cat .hg/hgrc
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    82
  [paths]
15447
9910f60a37ee tests: make (glob) on windows accept \ instead of /
Mads Kiilerich <mads@kiilerich.com>
parents: 13572
diff changeset
    83
  default = $TESTTMP/a#stable (glob)
12614
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    84
  green = ../a#default
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    85
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    86
  $ hg tout green
15447
9910f60a37ee tests: make (glob) on windows accept \ instead of /
Mads Kiilerich <mads@kiilerich.com>
parents: 13572
diff changeset
    87
  comparing with $TESTTMP/a (glob)
12614
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    88
  searching for changes
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    89
  3:f0461977a3db: '4' 
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    90
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    91
  $ hg tlog -r 'outgoing("green")'
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    92
  3:f0461977a3db: '4' 
f314723f36f5 revset: fix #branch in urls for outgoing()
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    93
16913
f2719b387380 tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents: 15623
diff changeset
    94
  $ cd ..