Commits

Pierre-Yves David committed bebc675

fix hg pull --rebase

There is more user of rebase than just the rebase command

Comments (0)

Files changed (2)

         repo.ui.warn(_('whole rebase set is extinct and ignored.\n'))
         return {}
     root = min(rebaseset)
-    if not repo._rebasekeep and not repo[root].mutable():
+    if (not getattr(repo, '_rebasekeep', False)
+        and not repo[root].mutable()):
         raise util.Abort(_("can't rebase immutable changeset %s") % repo[root],
                          hint=_('see hg help phases for details'))
     return orig(repo, dest, rebaseset, *ags, **kws)

tests/test-obsolete-rebase.t

   +a31943eabc4327df16f9eca71bf7779c32f815f7 03f165c84ea8889fc35a64a392caa7a0084dd212 0 {'date': '* *', 'user': 'test'} (glob)
   +4b9d80f48523e296f4402cc8e37236b768dfb981 1951ead9710803dbf117e95901954d5ed717f80b 0 {'date': '* *', 'user': 'test'} (glob)
   [1]
+
+Test hg pull --rebase
+
+  $ hg glog
+  @  changeset:   12:1951ead97108
+  |  tag:         tip
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     appendab
+  |
+  o  changeset:   11:03f165c84ea8
+  |  parent:      1:540395c44225
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     addd
+  |
+  | o  changeset:   8:a7773ffa7edc
+  |/   parent:      1:540395c44225
+  |    user:        test
+  |    date:        Thu Jan 01 00:00:00 1970 +0000
+  |    summary:     Collapsed revision
+  |
+  | o  changeset:   4:9c5494949763
+  |/   parent:      1:540395c44225
+  |    user:        test
+  |    date:        Thu Jan 01 00:00:00 1970 +0000
+  |    summary:     adde
+  |
+  | o  changeset:   2:102a90ea7b4a
+  | |  parent:      0:07f494440405
+  | |  user:        test
+  | |  date:        Thu Jan 01 00:00:00 1970 +0000
+  | |  summary:     addb
+  | |
+  o |  changeset:   1:540395c44225
+  |/   user:        test
+  |    date:        Thu Jan 01 00:00:00 1970 +0000
+  |    summary:     changea
+  |
+  o  changeset:   0:07f494440405
+     user:        test
+     date:        Thu Jan 01 00:00:00 1970 +0000
+     summary:     adda
+  
+  $ echo '[phases]' >> .hg/hgrc
+  $ echo 'publish=False' >> .hg/hgrc
+  $ hg clone . -r 540395c44225 ../other
+  adding changesets
+  adding manifests
+  adding file changes
+  added 2 changesets with 2 changes to 1 files
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg ph -vfd 'all()'
+  no phases changed
+  [1]
+  $ cd ../other
+  $ echo 'babar' > toto
+  $ hg add toto
+  $ hg ci -m 'babar is not dead'
+  $ echo '[ui]' >> .hg/hgrc
+  $ echo 'logtemplate={rev} {node|short} {desc|firstline}\n' >> .hg/hgrc
+  $ hg pull --rebase --traceback
+  pulling from $TESTTMP/repo
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 5 changesets with 5 changes to 5 files (+4 heads)
+  saved backup bundle to $TESTTMP/other/.hg/strip-backup/2a6c62a1b55d-backup.hg
+  $ hg glog
+  @  7 d5567dbec794 babar is not dead
+  |
+  o  6 1951ead97108 appendab
+  |
+  o  5 03f165c84ea8 addd
+  |
+  | o  4 a7773ffa7edc Collapsed revision
+  |/
+  | o  3 9c5494949763 adde
+  |/
+  | o  2 102a90ea7b4a addb
+  | |
+  o |  1 540395c44225 changea
+  |/
+  o  0 07f494440405 adda
+  
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.