tests/test-subrepo-missing.t
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
Wed, 05 Nov 2014 23:24:47 +0900
changeset 23183 51c9196a6bd0
parent 22955 fab9dda0f2a3
child 24479 871485bd03fd
permissions -rw-r--r--
largefiles: remove meaningless code path for "hg pull --rebase" This patch removes "--rebase" specific code path for "hg pull" in "overridepull", because previous patch makes it meaningless: now, "rebase.rebase" ("orig" invocation in this patch) can update/commit largefiles safely without "repo._isrebasing = True". As a side effect of removing "rebase.rebase" invocation in "overridepull", this patch removes "nothing to rebase ..." message in "test-largefiles.t", which is shown only when rebase extension is enabled AFTER largefiles: before this patch: 1. "dispatch" invokes "pullrebase" of rebase as "hg pull" at first, because rebase wraps "hg pull" later 2. "pullrebase" invokes "overridepull" of largefiles as "orig", even though rebase assumes that "orig" is "pull" of commands 3. "overridepull" executes "pull" and "rebase" directly 3.1 "pull" pulls changesets and creates new head "X" 3.2 "rebase" rebases current working parent "Y" on "X" 4. "overridepull" returns to "pullrebase" 5. "pullrebase" tries to rebase, but there is nothing to be done, because "Y" is already rebased on "X". then, it shows "nothing to rebase ..." after this patch: 1. "dispatch" invokes "pullrebase" of rebase as "hg pull" 2. "pullrebase" invokes "overridepull" of largefiles as "orig" 3. "overridepull" executes "pull" as "orig" 4. "overridepull" returns to "pullrebase" 5. revision "Y" is not yet rebased, so "pullrebase" doesn't shows "nothing to rebase ..." As another side effect of removing "rebase.rebase" invocation, this patch fixes issue3861, which occurs only when rebase extension is enabled BEFORE largefiles: before this patch: 1. "dispatch" invokes "overridepull" of largefiles at first, because largefiles wrap "hg pull" later 2. "overridepull" executes "pull" and "rebase" explicitly 2.1 "pull" pulls changesets and creates new head "X" 2.2 "rebase" rebases current working parent, but fails because no revision is checked out in issue3861 case 3. "overridepull" returns to "dispatch" with exit code 1 returned from "rebase" at (2.2) 4. "hg pull" terminates with exit code 1 unexpectedly after this patch: 1. "dispatch" invokes "overridepull" of largefiles at first 2. "overridepull" invokes "pullrebase" of rebase as "orig" 3. "pullrebase" invokes "pull" as "orig" 4. "pullrebase" invokes "rebase", and it fails 5. "pullrebase" returns to "overridepull" with exit code 0 (because "pullrebase" ignores result of "pull" and "rebase") 6. "overridepull" returns to "dispatch" with exit code 0 returned from "rebase" at (5) 7. "hg pull" terminates with exit code 0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
13017
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     1
  $ hg init repo
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     2
  $ cd repo
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     3
  $ hg init subrepo
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     4
  $ echo a > subrepo/a
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     5
  $ hg -R subrepo ci -Am adda
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     6
  adding a
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     7
  $ echo 'subrepo = subrepo' > .hgsub
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     8
  $ hg ci -Am addsubrepo
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     9
  adding .hgsub
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    10
  $ echo b > subrepo/b
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    11
  $ hg -R subrepo ci -Am addb
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    12
  adding b
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    13
  $ hg ci -m updatedsub
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    14
16595
2de6ac4ac17c subrepo: ignore blank lines in .hgsubstate (issue3424)
Patrick Mezard <patrick@mezard.eu>
parents: 16073
diff changeset
    15
ignore blanklines in .hgsubstate
2de6ac4ac17c subrepo: ignore blank lines in .hgsubstate (issue3424)
Patrick Mezard <patrick@mezard.eu>
parents: 16073
diff changeset
    16
2de6ac4ac17c subrepo: ignore blank lines in .hgsubstate (issue3424)
Patrick Mezard <patrick@mezard.eu>
parents: 16073
diff changeset
    17
  >>> file('.hgsubstate', 'wb').write('\n\n   \t \n   \n')
2de6ac4ac17c subrepo: ignore blank lines in .hgsubstate (issue3424)
Patrick Mezard <patrick@mezard.eu>
parents: 16073
diff changeset
    18
  $ hg st --subrepos
2de6ac4ac17c subrepo: ignore blank lines in .hgsubstate (issue3424)
Patrick Mezard <patrick@mezard.eu>
parents: 16073
diff changeset
    19
  M .hgsubstate
2de6ac4ac17c subrepo: ignore blank lines in .hgsubstate (issue3424)
Patrick Mezard <patrick@mezard.eu>
parents: 16073
diff changeset
    20
  $ hg revert -qC .hgsubstate
2de6ac4ac17c subrepo: ignore blank lines in .hgsubstate (issue3424)
Patrick Mezard <patrick@mezard.eu>
parents: 16073
diff changeset
    21
16596
95ca6c8b38da subrepo: do not traceback on .hgsubstate parsing errors
Patrick Mezard <patrick@mezard.eu>
parents: 16595
diff changeset
    22
abort more gracefully on .hgsubstate parsing error
95ca6c8b38da subrepo: do not traceback on .hgsubstate parsing errors
Patrick Mezard <patrick@mezard.eu>
parents: 16595
diff changeset
    23
95ca6c8b38da subrepo: do not traceback on .hgsubstate parsing errors
Patrick Mezard <patrick@mezard.eu>
parents: 16595
diff changeset
    24
  $ cp .hgsubstate .hgsubstate.old
95ca6c8b38da subrepo: do not traceback on .hgsubstate parsing errors
Patrick Mezard <patrick@mezard.eu>
parents: 16595
diff changeset
    25
  >>> file('.hgsubstate', 'wb').write('\ninvalid')
95ca6c8b38da subrepo: do not traceback on .hgsubstate parsing errors
Patrick Mezard <patrick@mezard.eu>
parents: 16595
diff changeset
    26
  $ hg st --subrepos
95ca6c8b38da subrepo: do not traceback on .hgsubstate parsing errors
Patrick Mezard <patrick@mezard.eu>
parents: 16595
diff changeset
    27
  abort: invalid subrepository revision specifier in .hgsubstate line 2
95ca6c8b38da subrepo: do not traceback on .hgsubstate parsing errors
Patrick Mezard <patrick@mezard.eu>
parents: 16595
diff changeset
    28
  [255]
95ca6c8b38da subrepo: do not traceback on .hgsubstate parsing errors
Patrick Mezard <patrick@mezard.eu>
parents: 16595
diff changeset
    29
  $ mv .hgsubstate.old .hgsubstate
95ca6c8b38da subrepo: do not traceback on .hgsubstate parsing errors
Patrick Mezard <patrick@mezard.eu>
parents: 16595
diff changeset
    30
13017
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    31
delete .hgsub and revert it
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    32
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    33
  $ rm .hgsub
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    34
  $ hg revert .hgsub
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    35
  warning: subrepo spec file .hgsub not found
14870
f73c7b70df68 subrepo: use working copy of .hgsub to filter status (issue2901)
Matt Mackall <mpm@selenic.com>
parents: 13017
diff changeset
    36
  warning: subrepo spec file .hgsub not found
13017
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    37
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    38
delete .hgsubstate and revert it
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    39
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    40
  $ rm .hgsubstate
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    41
  $ hg revert .hgsubstate
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    42
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    43
delete .hgsub and update
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    44
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    45
  $ rm .hgsub
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    46
  $ hg up 0
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    47
  warning: subrepo spec file .hgsub not found
14870
f73c7b70df68 subrepo: use working copy of .hgsub to filter status (issue2901)
Matt Mackall <mpm@selenic.com>
parents: 13017
diff changeset
    48
  warning: subrepo spec file .hgsub not found
13017
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    49
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    50
  $ hg st
14870
f73c7b70df68 subrepo: use working copy of .hgsub to filter status (issue2901)
Matt Mackall <mpm@selenic.com>
parents: 13017
diff changeset
    51
  warning: subrepo spec file .hgsub not found
13017
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    52
  ! .hgsub
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    53
  $ ls subrepo
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    54
  a
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    55
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    56
delete .hgsubstate and update
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    57
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    58
  $ hg up -C
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    59
  warning: subrepo spec file .hgsub not found
14870
f73c7b70df68 subrepo: use working copy of .hgsub to filter status (issue2901)
Matt Mackall <mpm@selenic.com>
parents: 13017
diff changeset
    60
  warning: subrepo spec file .hgsub not found
13017
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    61
  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    62
  $ rm .hgsubstate
17345
4f8054d3171b check-code: fix check for trailing whitespace on sh command lines
Mads Kiilerich <mads@kiilerich.com>
parents: 16913
diff changeset
    63
  $ hg up 0
13017
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    64
  remote changed .hgsubstate which local deleted
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    65
  use (c)hanged version or leave (d)eleted? c
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    66
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    67
  $ hg st
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    68
  $ ls subrepo
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    69
  a
16913
f2719b387380 tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents: 16596
diff changeset
    70
20319
427d672c0e4e subrepo: make it possible to update to hidden subrepo revisions
Angel Ezquerra <angel.ezquerra@gmail.com>
parents: 17345
diff changeset
    71
Enable obsolete
427d672c0e4e subrepo: make it possible to update to hidden subrepo revisions
Angel Ezquerra <angel.ezquerra@gmail.com>
parents: 17345
diff changeset
    72
427d672c0e4e subrepo: make it possible to update to hidden subrepo revisions
Angel Ezquerra <angel.ezquerra@gmail.com>
parents: 17345
diff changeset
    73
  $ cat >> $HGRCPATH << EOF
427d672c0e4e subrepo: make it possible to update to hidden subrepo revisions
Angel Ezquerra <angel.ezquerra@gmail.com>
parents: 17345
diff changeset
    74
  > [ui]
427d672c0e4e subrepo: make it possible to update to hidden subrepo revisions
Angel Ezquerra <angel.ezquerra@gmail.com>
parents: 17345
diff changeset
    75
  > logtemplate= {rev}:{node|short} {desc|firstline}
427d672c0e4e subrepo: make it possible to update to hidden subrepo revisions
Angel Ezquerra <angel.ezquerra@gmail.com>
parents: 17345
diff changeset
    76
  > [phases]
427d672c0e4e subrepo: make it possible to update to hidden subrepo revisions
Angel Ezquerra <angel.ezquerra@gmail.com>
parents: 17345
diff changeset
    77
  > publish=False
22955
fab9dda0f2a3 obsolete: update tests to use obsolete options
Durham Goode <durham@fb.com>
parents: 20319
diff changeset
    78
  > [experimental]
fab9dda0f2a3 obsolete: update tests to use obsolete options
Durham Goode <durham@fb.com>
parents: 20319
diff changeset
    79
  > evolution=createmarkers
20319
427d672c0e4e subrepo: make it possible to update to hidden subrepo revisions
Angel Ezquerra <angel.ezquerra@gmail.com>
parents: 17345
diff changeset
    80
  > EOF
427d672c0e4e subrepo: make it possible to update to hidden subrepo revisions
Angel Ezquerra <angel.ezquerra@gmail.com>
parents: 17345
diff changeset
    81
427d672c0e4e subrepo: make it possible to update to hidden subrepo revisions
Angel Ezquerra <angel.ezquerra@gmail.com>
parents: 17345
diff changeset
    82
check that we can update parent repo with missing (amended) subrepo revision
427d672c0e4e subrepo: make it possible to update to hidden subrepo revisions
Angel Ezquerra <angel.ezquerra@gmail.com>
parents: 17345
diff changeset
    83
427d672c0e4e subrepo: make it possible to update to hidden subrepo revisions
Angel Ezquerra <angel.ezquerra@gmail.com>
parents: 17345
diff changeset
    84
  $ hg up --repository subrepo -r tip
427d672c0e4e subrepo: make it possible to update to hidden subrepo revisions
Angel Ezquerra <angel.ezquerra@gmail.com>
parents: 17345
diff changeset
    85
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
427d672c0e4e subrepo: make it possible to update to hidden subrepo revisions
Angel Ezquerra <angel.ezquerra@gmail.com>
parents: 17345
diff changeset
    86
  $ hg ci -m "updated subrepo to tip"
427d672c0e4e subrepo: make it possible to update to hidden subrepo revisions
Angel Ezquerra <angel.ezquerra@gmail.com>
parents: 17345
diff changeset
    87
  created new head
427d672c0e4e subrepo: make it possible to update to hidden subrepo revisions
Angel Ezquerra <angel.ezquerra@gmail.com>
parents: 17345
diff changeset
    88
  $ cd subrepo
427d672c0e4e subrepo: make it possible to update to hidden subrepo revisions
Angel Ezquerra <angel.ezquerra@gmail.com>
parents: 17345
diff changeset
    89
  $ hg update -r tip
427d672c0e4e subrepo: make it possible to update to hidden subrepo revisions
Angel Ezquerra <angel.ezquerra@gmail.com>
parents: 17345
diff changeset
    90
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
427d672c0e4e subrepo: make it possible to update to hidden subrepo revisions
Angel Ezquerra <angel.ezquerra@gmail.com>
parents: 17345
diff changeset
    91
  $ echo foo > a
427d672c0e4e subrepo: make it possible to update to hidden subrepo revisions
Angel Ezquerra <angel.ezquerra@gmail.com>
parents: 17345
diff changeset
    92
  $ hg commit --amend -m "addb (amended)"
16913
f2719b387380 tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents: 16596
diff changeset
    93
  $ cd ..
20319
427d672c0e4e subrepo: make it possible to update to hidden subrepo revisions
Angel Ezquerra <angel.ezquerra@gmail.com>
parents: 17345
diff changeset
    94
  $ hg update --clean .
427d672c0e4e subrepo: make it possible to update to hidden subrepo revisions
Angel Ezquerra <angel.ezquerra@gmail.com>
parents: 17345
diff changeset
    95
  revision 102a90ea7b4a in subrepo subrepo is hidden
427d672c0e4e subrepo: make it possible to update to hidden subrepo revisions
Angel Ezquerra <angel.ezquerra@gmail.com>
parents: 17345
diff changeset
    96
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
427d672c0e4e subrepo: make it possible to update to hidden subrepo revisions
Angel Ezquerra <angel.ezquerra@gmail.com>
parents: 17345
diff changeset
    97
427d672c0e4e subrepo: make it possible to update to hidden subrepo revisions
Angel Ezquerra <angel.ezquerra@gmail.com>
parents: 17345
diff changeset
    98
  $ cd ..