tests/test-rebase-rename.t
author Patrick Mezard <pmezard@gmail.com>
Fri, 27 May 2011 21:50:09 +0200
changeset 14451 c78d41db6f88
parent 13778 46c3043253fb
child 16913 f2719b387380
permissions -rw-r--r--
patch: refactor file creation/removal detection The patcher has to know if a file is being created or removed to check if the target already exists, or to actually unlink the file when a hunk emptying it is applied. This was done by embedding the creation/removal information in the first (and only) hunk attached to the file. There are two problems with this approach: - creation/removal is really a property of the file being patched and not its hunk. - for regular patches, file creation cannot be deduced at parsing time: there are case where the *stripped* file paths must be compared. Modifying hunks after their creation is clumsy and prevent further refactorings related to copies handling. Instead, we delegate this job to selectfile() which has all the relevant information, and remove the hunk createfile() and rmfile() methods.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
12608
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
     1
  $ cat >> $HGRCPATH <<EOF
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
     2
  > [extensions]
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
     3
  > graphlog=
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
     4
  > rebase=
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
     5
  > 
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
     6
  > [alias]
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
     7
  > tlog  = log  --template "{rev}: '{desc}' {branches}\n"
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
     8
  > tglog = tlog --graph
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
     9
  > EOF
7954
b969611064ae rebase: don't lose rename/copy data (Issue1423)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    10
12608
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    11
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    12
  $ hg init a
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    13
  $ cd a
11198
b345b1cc124f rebase: use helpers.sh in tests
Matt Mackall <mpm@selenic.com>
parents: 7954
diff changeset
    14
12608
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    15
  $ echo a > a
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    16
  $ hg ci -Am A
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    17
  adding a
7954
b969611064ae rebase: don't lose rename/copy data (Issue1423)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    18
12608
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    19
  $ echo b > b
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    20
  $ hg ci -Am B
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    21
  adding b
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    22
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    23
  $ hg up -q -C 0
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    24
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    25
  $ hg mv a a-renamed
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    26
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    27
  $ hg ci -m 'rename A'
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    28
  created new head
7954
b969611064ae rebase: don't lose rename/copy data (Issue1423)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    29
12608
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    30
  $ hg tglog
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    31
  @  2: 'rename A'
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    32
  |
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    33
  | o  1: 'B'
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    34
  |/
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    35
  o  0: 'A'
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    36
  
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    37
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    38
Rename is tracked:
7954
b969611064ae rebase: don't lose rename/copy data (Issue1423)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    39
12608
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    40
  $ hg tlog -p --git -r tip
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    41
  2: 'rename A' 
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    42
  diff --git a/a b/a-renamed
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    43
  rename from a
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    44
  rename to a-renamed
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    45
  
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    46
Rebase the revision containing the rename:
7954
b969611064ae rebase: don't lose rename/copy data (Issue1423)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    47
12608
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    48
  $ hg rebase -s 2 -d 1
12640
6cc4b14fb76b tests: remove redundant globs
Mads Kiilerich <mads@kiilerich.com>
parents: 12608
diff changeset
    49
  saved backup bundle to $TESTTMP/a/.hg/strip-backup/*-backup.hg (glob)
12608
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    50
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    51
  $ hg tglog
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    52
  @  2: 'rename A'
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    53
  |
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    54
  o  1: 'B'
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    55
  |
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    56
  o  0: 'A'
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    57
  
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    58
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    59
Rename is not lost:
7954
b969611064ae rebase: don't lose rename/copy data (Issue1423)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    60
12608
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    61
  $ hg tlog -p --git -r tip
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    62
  2: 'rename A' 
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    63
  diff --git a/a b/a-renamed
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    64
  rename from a
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    65
  rename to a-renamed
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    66
  
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    67
  $ cd ..
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    68
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    69
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    70
  $ hg init b
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    71
  $ cd b
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    72
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    73
  $ echo a > a
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    74
  $ hg ci -Am A
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    75
  adding a
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    76
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    77
  $ echo b > b
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    78
  $ hg ci -Am B
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    79
  adding b
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    80
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    81
  $ hg up -q -C 0
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    82
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    83
  $ hg cp a a-copied
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    84
  $ hg ci -m 'copy A'
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    85
  created new head
7954
b969611064ae rebase: don't lose rename/copy data (Issue1423)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    86
12608
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    87
  $ hg tglog
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    88
  @  2: 'copy A'
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    89
  |
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    90
  | o  1: 'B'
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    91
  |/
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    92
  o  0: 'A'
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    93
  
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    94
Copy is tracked:
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    95
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    96
  $ hg tlog -p --git -r tip
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    97
  2: 'copy A' 
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    98
  diff --git a/a b/a-copied
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    99
  copy from a
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
   100
  copy to a-copied
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
   101
  
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
   102
Rebase the revision containing the copy:
7954
b969611064ae rebase: don't lose rename/copy data (Issue1423)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
   103
12608
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
   104
  $ hg rebase -s 2 -d 1
12640
6cc4b14fb76b tests: remove redundant globs
Mads Kiilerich <mads@kiilerich.com>
parents: 12608
diff changeset
   105
  saved backup bundle to $TESTTMP/b/.hg/strip-backup/*-backup.hg (glob)
7954
b969611064ae rebase: don't lose rename/copy data (Issue1423)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
   106
12608
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
   107
  $ hg tglog
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
   108
  @  2: 'copy A'
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
   109
  |
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
   110
  o  1: 'B'
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
   111
  |
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
   112
  o  0: 'A'
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
   113
  
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
   114
Copy is not lost:
7954
b969611064ae rebase: don't lose rename/copy data (Issue1423)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
   115
12608
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
   116
  $ hg tlog -p --git -r tip
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
   117
  2: 'copy A' 
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
   118
  diff --git a/a b/a-copied
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
   119
  copy from a
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
   120
  copy to a-copied
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
   121
  
13778
46c3043253fb rebase: don't mark file as removed if missing in parent's manifest (issue2725)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 12640
diff changeset
   122
  $ cd ..
46c3043253fb rebase: don't mark file as removed if missing in parent's manifest (issue2725)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 12640
diff changeset
   123
46c3043253fb rebase: don't mark file as removed if missing in parent's manifest (issue2725)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 12640
diff changeset
   124
46c3043253fb rebase: don't mark file as removed if missing in parent's manifest (issue2725)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 12640
diff changeset
   125
Test rebase across repeating renames:
46c3043253fb rebase: don't mark file as removed if missing in parent's manifest (issue2725)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 12640
diff changeset
   126
46c3043253fb rebase: don't mark file as removed if missing in parent's manifest (issue2725)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 12640
diff changeset
   127
  $ hg init repo
46c3043253fb rebase: don't mark file as removed if missing in parent's manifest (issue2725)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 12640
diff changeset
   128
46c3043253fb rebase: don't mark file as removed if missing in parent's manifest (issue2725)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 12640
diff changeset
   129
  $ cd repo
46c3043253fb rebase: don't mark file as removed if missing in parent's manifest (issue2725)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 12640
diff changeset
   130
46c3043253fb rebase: don't mark file as removed if missing in parent's manifest (issue2725)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 12640
diff changeset
   131
  $ echo testing > file1.txt
46c3043253fb rebase: don't mark file as removed if missing in parent's manifest (issue2725)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 12640
diff changeset
   132
  $ hg add file1.txt
46c3043253fb rebase: don't mark file as removed if missing in parent's manifest (issue2725)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 12640
diff changeset
   133
  $ hg ci -m "Adding file1"
46c3043253fb rebase: don't mark file as removed if missing in parent's manifest (issue2725)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 12640
diff changeset
   134
46c3043253fb rebase: don't mark file as removed if missing in parent's manifest (issue2725)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 12640
diff changeset
   135
  $ hg rename file1.txt file2.txt
46c3043253fb rebase: don't mark file as removed if missing in parent's manifest (issue2725)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 12640
diff changeset
   136
  $ hg ci -m "Rename file1 to file2"
46c3043253fb rebase: don't mark file as removed if missing in parent's manifest (issue2725)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 12640
diff changeset
   137
46c3043253fb rebase: don't mark file as removed if missing in parent's manifest (issue2725)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 12640
diff changeset
   138
  $ echo Unrelated change > unrelated.txt
46c3043253fb rebase: don't mark file as removed if missing in parent's manifest (issue2725)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 12640
diff changeset
   139
  $ hg add unrelated.txt
46c3043253fb rebase: don't mark file as removed if missing in parent's manifest (issue2725)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 12640
diff changeset
   140
  $ hg ci -m "Unrelated change"
46c3043253fb rebase: don't mark file as removed if missing in parent's manifest (issue2725)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 12640
diff changeset
   141
46c3043253fb rebase: don't mark file as removed if missing in parent's manifest (issue2725)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 12640
diff changeset
   142
  $ hg rename file2.txt file1.txt
46c3043253fb rebase: don't mark file as removed if missing in parent's manifest (issue2725)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 12640
diff changeset
   143
  $ hg ci -m "Rename file2 back to file1"
46c3043253fb rebase: don't mark file as removed if missing in parent's manifest (issue2725)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 12640
diff changeset
   144
46c3043253fb rebase: don't mark file as removed if missing in parent's manifest (issue2725)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 12640
diff changeset
   145
  $ hg update -r -2
46c3043253fb rebase: don't mark file as removed if missing in parent's manifest (issue2725)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 12640
diff changeset
   146
  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
46c3043253fb rebase: don't mark file as removed if missing in parent's manifest (issue2725)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 12640
diff changeset
   147
46c3043253fb rebase: don't mark file as removed if missing in parent's manifest (issue2725)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 12640
diff changeset
   148
  $ echo Another unrelated change >> unrelated.txt
46c3043253fb rebase: don't mark file as removed if missing in parent's manifest (issue2725)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 12640
diff changeset
   149
  $ hg ci -m "Another unrelated change"
46c3043253fb rebase: don't mark file as removed if missing in parent's manifest (issue2725)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 12640
diff changeset
   150
  created new head
46c3043253fb rebase: don't mark file as removed if missing in parent's manifest (issue2725)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 12640
diff changeset
   151
46c3043253fb rebase: don't mark file as removed if missing in parent's manifest (issue2725)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 12640
diff changeset
   152
  $ hg tglog
46c3043253fb rebase: don't mark file as removed if missing in parent's manifest (issue2725)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 12640
diff changeset
   153
  @  4: 'Another unrelated change'
46c3043253fb rebase: don't mark file as removed if missing in parent's manifest (issue2725)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 12640
diff changeset
   154
  |
46c3043253fb rebase: don't mark file as removed if missing in parent's manifest (issue2725)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 12640
diff changeset
   155
  | o  3: 'Rename file2 back to file1'
46c3043253fb rebase: don't mark file as removed if missing in parent's manifest (issue2725)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 12640
diff changeset
   156
  |/
46c3043253fb rebase: don't mark file as removed if missing in parent's manifest (issue2725)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 12640
diff changeset
   157
  o  2: 'Unrelated change'
46c3043253fb rebase: don't mark file as removed if missing in parent's manifest (issue2725)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 12640
diff changeset
   158
  |
46c3043253fb rebase: don't mark file as removed if missing in parent's manifest (issue2725)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 12640
diff changeset
   159
  o  1: 'Rename file1 to file2'
46c3043253fb rebase: don't mark file as removed if missing in parent's manifest (issue2725)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 12640
diff changeset
   160
  |
46c3043253fb rebase: don't mark file as removed if missing in parent's manifest (issue2725)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 12640
diff changeset
   161
  o  0: 'Adding file1'
46c3043253fb rebase: don't mark file as removed if missing in parent's manifest (issue2725)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 12640
diff changeset
   162
  
46c3043253fb rebase: don't mark file as removed if missing in parent's manifest (issue2725)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 12640
diff changeset
   163
46c3043253fb rebase: don't mark file as removed if missing in parent's manifest (issue2725)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 12640
diff changeset
   164
  $ hg rebase -s 4 -d 3
46c3043253fb rebase: don't mark file as removed if missing in parent's manifest (issue2725)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 12640
diff changeset
   165
  saved backup bundle to $TESTTMP/repo/.hg/strip-backup/*-backup.hg (glob)
46c3043253fb rebase: don't mark file as removed if missing in parent's manifest (issue2725)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 12640
diff changeset
   166
46c3043253fb rebase: don't mark file as removed if missing in parent's manifest (issue2725)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 12640
diff changeset
   167
  $ hg diff --stat -c .
46c3043253fb rebase: don't mark file as removed if missing in parent's manifest (issue2725)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 12640
diff changeset
   168
   unrelated.txt |  1 +
46c3043253fb rebase: don't mark file as removed if missing in parent's manifest (issue2725)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 12640
diff changeset
   169
   1 files changed, 1 insertions(+), 0 deletions(-)
46c3043253fb rebase: don't mark file as removed if missing in parent's manifest (issue2725)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 12640
diff changeset
   170