tests/test-rebase-dry-run.t
author Pierre-Yves David <pierre-yves.david@octobus.net>
Fri, 22 Dec 2023 12:58:54 +0100
changeset 51319 da7ecb4deaec
parent 50340 9f33d12f6f48
permissions -rw-r--r--
delta-find: add a small docstring to deltacomputer As we are about to introduce another object related to finding delta. So lets have a minimal docstring to the existing one.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
50339
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
     1
======================
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
     2
rebase --dry-run tests
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
     3
======================
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
     4
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
     5
Test behavior associated with `hg rebase --dry-run`
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
     6
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
     7
Setup
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
     8
=====
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
     9
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    10
  $ hg init r1
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    11
  $ cd r1
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    12
  $ echo one > f01.txt
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    13
  $ echo two > f02.txt
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    14
  $ echo three > f03.txt
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    15
  $ hg add
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    16
  adding f01.txt
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    17
  adding f02.txt
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    18
  adding f03.txt
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    19
  $ hg ci -m 'ci-1' f01.txt f02.txt f03.txt
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    20
  $ hg book base; hg book -i
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    21
  $ echo add-to-one >> f01.txt
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    22
  $ hg ci -m 'br-1' f01.txt
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    23
  $ hg book branch-1; hg book -i
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    24
  $ hg up base; hg book -i
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    25
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    26
  (activating bookmark base)
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    27
  $ echo add-to-two >> f02.txt
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    28
  $ hg ci -m 'br-2' f02.txt
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    29
  created new head
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    30
  $ hg book branch-2; hg book -i
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    31
  $ hg up branch-1; hg book -i
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    32
  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    33
  (activating bookmark branch-1)
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    34
  $ hg log -G
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    35
  o  changeset:   2:d408211b0a6f
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    36
  |  bookmark:    branch-2
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    37
  |  tag:         tip
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    38
  |  parent:      0:99418d161ee0
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    39
  |  user:        test
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    40
  |  date:        Thu Jan 01 00:00:00 1970 +0000
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    41
  |  summary:     br-2
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    42
  |
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    43
  | @  changeset:   1:ab62441498e5
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    44
  |/   bookmark:    branch-1
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    45
  |    user:        test
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    46
  |    date:        Thu Jan 01 00:00:00 1970 +0000
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    47
  |    summary:     br-1
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    48
  |
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    49
  o  changeset:   0:99418d161ee0
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    50
     bookmark:    base
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    51
     user:        test
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    52
     date:        Thu Jan 01 00:00:00 1970 +0000
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    53
     summary:     ci-1
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    54
  
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    55
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    56
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    57
Check the working copy changes do not get wiped out
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    58
===================================================
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    59
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    60
  $ echo add-to-three >> f03.txt
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    61
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    62
f03 is modified
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    63
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    64
  $ hg st
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    65
  M f03.txt
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    66
  $ hg diff
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    67
  diff -r ab62441498e5 f03.txt
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    68
  --- a/f03.txt	Thu Jan 01 00:00:00 1970 +0000
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    69
  +++ b/f03.txt	Thu Jan 01 00:00:00 1970 +0000
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    70
  @@ -1,1 +1,2 @@
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    71
   three
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    72
  +add-to-three
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    73
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    74
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    75
  $ hg rebase -v -n -s branch-2 -d branch-1 --config extensions.rebase=
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    76
  starting dry-run rebase; repository will not be changed
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    77
  rebasing 2:d408211b0a6f branch-2 tip "br-2"
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    78
  resolving manifests
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    79
  getting f02.txt
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    80
  committing files:
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    81
  f02.txt
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    82
  committing manifest
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    83
  committing changelog
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    84
  rebase merging completed
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    85
  dry-run rebase completed successfully; run without -n/--dry-run to perform this rebase
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    86
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    87
f03 changes are lost
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    88
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    89
  $ hg st
50340
9f33d12f6f48 rebase: do not cleanup the working copy when --dry-run is used (issue6802)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50339
diff changeset
    90
  M f03.txt
50339
b469c5ceaa85 rebase: add a test showing that --dry-run wipes working copy changes
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    91
  $ hg diff
50340
9f33d12f6f48 rebase: do not cleanup the working copy when --dry-run is used (issue6802)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50339
diff changeset
    92
  diff -r ab62441498e5 f03.txt
9f33d12f6f48 rebase: do not cleanup the working copy when --dry-run is used (issue6802)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50339
diff changeset
    93
  --- a/f03.txt	Thu Jan 01 00:00:00 1970 +0000
9f33d12f6f48 rebase: do not cleanup the working copy when --dry-run is used (issue6802)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50339
diff changeset
    94
  +++ b/f03.txt	Thu Jan 01 00:00:00 1970 +0000
9f33d12f6f48 rebase: do not cleanup the working copy when --dry-run is used (issue6802)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50339
diff changeset
    95
  @@ -1,1 +1,2 @@
9f33d12f6f48 rebase: do not cleanup the working copy when --dry-run is used (issue6802)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50339
diff changeset
    96
   three
9f33d12f6f48 rebase: do not cleanup the working copy when --dry-run is used (issue6802)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50339
diff changeset
    97
  +add-to-three