facebook / sapling

A Scalable, User-Friendly Source Control System.
https://sapling-scm.com
GNU General Public License v2.0
6.16k stars 284 forks source link

bug(rebase): sapling crashes during rebase #449

Open vegerot opened 1 year ago

vegerot commented 1 year ago

Haven't looked into this, but figured I'd just report this. Let me know what other information I can give you to reproduce

sl status && sl ssl
  @  28afa  Yesterday at 10:34  mchcopl  #440 Unreviewed ✓
  │  (build): Use Sapling HEAD for sl version by default in `make oss`
  │
  o  2c799  Yesterday at 10:34  mchcopl  #439 Unreviewed ✓
╭─╯  (build): Support sapling in tag-name.sh
│
o  09756  69 minutes ago  remote/main upstream/main
╷
╷ o  b84d  Wednesday at 10:51  mchcopl  #349 Unreviewed ✓
╷ │  util: show all dirty status indicators
╷ │
╷ o  944e65  Wednesday at 10:50  mchcopl  #348 Unreviewed ✓
╭─╯  util: add zsh prompt
│
│ o  d615  Yesterday at 10:28  mchcopl  #369 Unreviewed ✓
├─╯  Add completion for sapling
│
│ o  5e1d5  Yesterday at 10:28  mchcopl
├─╯  (format): Align revsetlang elements table
│
│ o  a2d44  Wednesday at 17:13  mchcopl  #448 Unreviewed ✓
├─╯  feat(scm): Add revset aliases for `next` and `prev`
│
o  b318b  Wednesday at 08:51
╷
╷ x  fd878a [Rebased to 5e1d5b0a798a]  Jan 06 at 16:54  mchcopl  remote/align
╭─╯  (format): Align revsetlang elements table
│
o  97ec  Dec 30 at 16:09
│
~
sl rebase --rev 'draft()' --dest remote/main
note: not rebasing fd878a29af1d "(format): Align revsetlang elements table" (remote/align align) and its descendants as this would cause divergence
rebasing 944e65dc6b37 "util: add zsh prompt"
rebasing b84d503fc6a8 "util: show all dirty status indicators"
** Sapling SCM (version 0.2.20221222-152408) has crashed:
Traceback (most recent call last):
  File "/usr/local/Cellar/python@3.11/3.11.1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/edenscm/__init__.py", line 106, in run
    dispatch.run(args, fin, fout, ferr, config)
  File "/usr/local/Cellar/python@3.11/3.11.1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/edenscm/dispatch.py", line 161, in run
    status = (dispatch(req) or 0) & 255
              ^^^^^^^^^^^^^
  File "/usr/local/Cellar/python@3.11/3.11.1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/edenscm/dispatch.py", line 503, in dispatch
    ret = _runcatch(req)
          ^^^^^^^^^^^^^^
  File "/usr/local/Cellar/python@3.11/3.11.1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/edenscm/dispatch.py", line 712, in _runcatch
    return _callcatch(ui, req, _runcatchfunc)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/python@3.11/3.11.1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/edenscm/dispatch.py", line 721, in _callcatch
    return scmutil.callcatch(ui, req, func)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/python@3.11/3.11.1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/edenscm/scmutil.py", line 147, in callcatch
    return func()
           ^^^^^^
  File "/usr/local/Cellar/python@3.11/3.11.1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/edenscm/dispatch.py", line 683, in _runcatchfunc
    return _dispatch(req)
           ^^^^^^^^^^^^^^
  File "/usr/local/Cellar/python@3.11/3.11.1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/edenscm/dispatch.py", line 1218, in _dispatch
    ret = runcommand(
          ^^^^^^^^^^^
  File "/usr/local/Cellar/python@3.11/3.11.1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/edenscm/ext/undo.py", line 146, in _runcommandwrapper
    result = orig(lui, repo, cmd, fullargs, *args)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/python@3.11/3.11.1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/edenscm/ext/journal.py", line 80, in runcommand
    return orig(lui, repo, cmd, fullargs, *args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/python@3.11/3.11.1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/edenscm/ext/sparse.py", line 504, in _tracktelemetry
    res = runcommand(lui, repo, *args)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/python@3.11/3.11.1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/edenscm/ext/copytrace.py", line 163, in _runcommand
    return orig(lui, repo, cmd, fullargs, ui, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/python@3.11/3.11.1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/edenscm/dispatch.py", line 913, in runcommand
    ret = _runcommand(ui, options, cmd, d)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/python@3.11/3.11.1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/edenscm/dispatch.py", line 1259, in _runcommand
    return cmdfunc()
           ^^^^^^^^^
  File "/usr/local/Cellar/python@3.11/3.11.1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/edenscm/dispatch.py", line 1217, in <lambda>
    d = lambda: util.checksignature(func)(ui, *args, **strcmdopt)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/python@3.11/3.11.1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/edenscm/util.py", line 1295, in check
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/python@3.11/3.11.1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/edenscm/util.py", line 1295, in check
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/python@3.11/3.11.1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/edenscm/ext/remotenames.py", line 395, in exrebasecmd
    ret = orig(ui, repo, *pats, **opts)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/python@3.11/3.11.1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/edenscm/util.py", line 1295, in check
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/python@3.11/3.11.1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/edenscm/util.py", line 1295, in check
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/python@3.11/3.11.1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/edenscm/ext/fbhistedit.py", line 359, in _rebase
    return orig(ui, repo, *pats, **opts)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/python@3.11/3.11.1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/edenscm/util.py", line 1295, in check
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/python@3.11/3.11.1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/edenscm/util.py", line 1295, in check
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/python@3.11/3.11.1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/edenscm/ext/tweakdefaults.py", line 531, in _rebase
    return orig(ui, repo, *pats, **opts)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/python@3.11/3.11.1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/edenscm/util.py", line 1295, in check
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/python@3.11/3.11.1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/edenscm/util.py", line 1295, in check
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/python@3.11/3.11.1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/edenscm/ext/amend/__init__.py", line 655, in wraprebase
    return orig(ui, repo, *pats, **opts)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/python@3.11/3.11.1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/edenscm/util.py", line 1295, in check
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/python@3.11/3.11.1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/edenscm/ext/rebase.py", line 1258, in rebase
    return _origrebase(ui, repo, rbsrt, **opts)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/python@3.11/3.11.1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/edenscm/ext/rebase.py", line 1352, in _origrebase
    rbsrt._performrebase(tr)
  File "/usr/local/Cellar/python@3.11/3.11.1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/edenscm/ext/rebase.py", line 579, in _performrebase
    pos = self._performrebasesubset(tr, subset, pos, prog)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/python@3.11/3.11.1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/edenscm/ext/rebase.py", line 641, in _performrebasesubset
    self._performrebaseone(rev, ctx, desc, tr, dest)
  File "/usr/local/Cellar/python@3.11/3.11.1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/edenscm/ext/rebase.py", line 810, in _performrebaseone
    p1, p2, base = defineparents(
                   ^^^^^^^^^^^^^^
  File "/usr/local/Cellar/python@3.11/3.11.1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/edenscm/ext/rebase.py", line 1855, in defineparents
    dests = adjustdest(repo, rev, destmap, state, skipped)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/python@3.11/3.11.1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/edenscm/ext/rebase.py", line 1769, in adjustdest
    source = [
             ^
  File "/usr/local/Cellar/python@3.11/3.11.1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/edenscm/ext/rebase.py", line 1770, in <listcomp>
    s for s, d in state.items() if d > 0 and destmap[s] == dest and s not in skipped
                                             ~~~~~~~^^^
  File "/usr/local/Cellar/python@3.11/3.11.1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/edenscm/ext/rebase.py", line 188, in __getitem__
    return self._rev2rev.__getitem__(rev)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
KeyError: 72057594037927986

sl rebase --abort && sl ssl

  @  28afa  Yesterday at 10:34  mchcopl  #440 Unreviewed ✓
  │  (build): Use Sapling HEAD for sl version by default in `make oss`
  │
  o  2c799  Yesterday at 10:34  mchcopl  #439 Unreviewed ✓
╭─╯  (build): Support sapling in tag-name.sh
│
│ o  1245  2 minutes ago  mchcopl  #348 Unreviewed ✓
├─╯  util: add zsh prompt
│
o  09756  72 minutes ago  remote/main upstream/main
╷
╷ o  b84d  Wednesday at 10:51  mchcopl  #349 Unreviewed ✓
╷ │  util: show all dirty status indicators
╷ │
╷ x  944e65 [Rebased to 12455cf49583]  Wednesday at 10:50  mchcopl  #348 Unreviewed ✓
╭─╯  util: add zsh prompt
│
│ o  d615  Yesterday at 10:28  mchcopl  #369 Unreviewed ✓
├─╯  Add completion for sapling
│
│ o  5e1d5  Yesterday at 10:28  mchcopl
├─╯  (format): Align revsetlang elements table
│
│ o  a2d44  Wednesday at 17:13  mchcopl  #448 Unreviewed ✓
├─╯  feat(scm): Add revset aliases for `next` and `prev`
│
o  b318b  Wednesday at 08:51
╷
╷ x  fd878a [Rebased to 5e1d5b0a798a]  Jan 06 at 16:54  mchcopl  remote/align
╭─╯  (format): Align revsetlang elements table
│
o  97ec  Dec 30 at 16:09
│
~
vegerot commented 1 year ago

Trying again works 🤷‍♀️

sl rebase --rev 'draft()' --dest remote/main
note: not rebasing fd878a29af1d "(format): Align revsetlang elements table" (remote/align align) and its descendants as this would cause divergence
note: not rebasing 944e65dc6b37 "util: add zsh prompt" and its descendants as this would cause divergence
rebasing a2d44c221bf6 "feat(scm): Add revset aliases for `next` and `prev`"
rebasing 5e1d5b0a798a "(format): Align revsetlang elements table"
rebasing d6157db1ebc0 "Add completion for sapling"
already rebased 12455cf49583 "util: add zsh prompt"
already rebased 2c79988674b5 "(build): Support sapling in tag-name.sh"
already rebased 28afa71ca66d "(build): Use Sapling HEAD for sl version by default in `make oss`"
a2d44c221bf6 -> a0e48b75eafb "feat(scm): Add revset aliases for `next` and `p..."
5e1d5b0a798a -> e8aa1eb61537 "(format): Align revsetlang elements table"
d6157db1ebc0 -> b6bedda5730f "Add completion for sapling"
sst
  @  28afa  Yesterday at 10:34  mchcopl  #440 Unreviewed ✓
  │  (build): Use Sapling HEAD for sl version by default in `make oss`
  │
  o  2c799  Yesterday at 10:34  mchcopl  #439 Unreviewed ✓
╭─╯  (build): Support sapling in tag-name.sh
│
│ o  b6be  6 seconds ago  mchcopl  #369 Unreviewed ✓
├─╯  Add completion for sapling
│
│ o  e8aa1  6 seconds ago  mchcopl
├─╯  (format): Align revsetlang elements table
│
│ o  a0e48  6 seconds ago  mchcopl  #448 Unreviewed ✓
├─╯  feat(scm): Add revset aliases for `next` and `prev`
│
│ o  1245  3 minutes ago  mchcopl  #348 Unreviewed ✓
├─╯  util: add zsh prompt
│
o  09756  73 minutes ago  remote/main upstream/main
╷
╷ o  b84d  Wednesday at 10:51  mchcopl  #349 Unreviewed ✓
╷ │  util: show all dirty status indicators
╷ │
╷ x  944e65 [Rebased to 12455cf49583]  Wednesday at 10:50  mchcopl  #348 Unreviewed ✓
╭─╯  util: add zsh prompt
│
o  b318b  Wednesday at 08:51
╷
╷ x  fd878a [Rewritten into e8aa1eb61537]  Jan 06 at 16:54  mchcopl  remote/align
╭─╯  (format): Align revsetlang elements table
│
o  97ec  Dec 30 at 16:09
│
~

(note: I still had to manually rebase b84d for some reason)