-
Notifications
You must be signed in to change notification settings - Fork 289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[proposal] sl goto top/bottom/prev/next ? #444
Labels
Comments
I too make this mistake frequently. FYI We should add a revset aliases for |
vegerot
added a commit
to vegerot/sapling
that referenced
this issue
Jan 11, 2023
Summary: In the same way you can `sl go top`, it seems logical to also have `sl go next`. However, instead it is `sl next`. While I normally remember to do `sl prev`, I sometimes accidentally do `sl go prev` out of habbit and get an error. Instead, let's simply add two revset aliases for `next` and `prev` to make sl more intuitive. Closes facebook#444 Test Plan: Automated tested blocked on facebook#447 Manually tested by running `sl go next` and `sl go prev` and verifying I ended up in the right spot. Question for reviewer: I don't know if this is relevant to this patch or not but while testing this I would sometimes have this error ```py ./sl Traceback (most recent call last): File "/Users/m0c0j7y/workspace/github.com/facebook/sapling/eden/scm/edenscm/__init__.py", line 86, in run dispatch.runchgserver(args[2:]) File "/Users/m0c0j7y/workspace/github.com/facebook/sapling/eden/scm/edenscm/dispatch.py", line 368, in runchgserver _preimportmodules() File "/Users/m0c0j7y/workspace/github.com/facebook/sapling/eden/scm/edenscm/dispatch.py", line 348, in _preimportmodules extensions.preimport(extname) File "/Users/m0c0j7y/workspace/github.com/facebook/sapling/eden/scm/edenscm/extensions.py", line 208, in preimport mod = getattr(__import__("edenscm.ext.%s" % name).ext, name) File "/Users/m0c0j7y/workspace/github.com/facebook/sapling/eden/scm/edenscm/ext/copytrace.py", line 169, in <module> ) -> Tuple[Optional[dbm._Database], Optional[Tuple[Type[dbm._error], Type[OSError]]]]: AttributeError: module 'dbm' has no attribute '_Database' ``` and other times I would get this warning ```python CHGDISABLE=1 ./sl go prev Traceback (most recent call last): File "/Users/m0c0j7y/workspace/github.com/facebook/sapling/eden/scm/edenscm/extensions.py", line 399, in _runextsetup extsetup(ui) File "/Users/m0c0j7y/workspace/github.com/facebook/sapling/eden/scm/edenscm/ext/copytrace.py", line 113, in extsetup extensions.wrapfunction(copiesmod, "mergecopies", _mergecopies) NameError: name '_mergecopies' is not defined warning: failed to set up extension copytrace: name '_mergecopies' is not defined 1 files updated, 0 files merged, 0 files removed, 0 files unresolved ```
vegerot
added a commit
to vegerot/sapling
that referenced
this issue
Jan 12, 2023
Summary: In the same way you can `sl go top`, it seems logical to also have `sl go next`. However, instead it is `sl next`. While I normally remember to do `sl prev`, I sometimes accidentally do `sl go prev` out of habbit and get an error. Instead, let's simply add two revset aliases for `next` and `prev` to make sl more intuitive. Differences from `sl next/prev`: - Cannot specify number of commits: `sl prev 2` works but `sl goto prev 2` doesn't. (but `sl go prev~1` would) - Handles merge commits differently. No interactive selection and no `sl next --newest` Closes facebook#444 Test Plan: Automated tested blocked on facebook#447 Manually tested by running `sl go next` and `sl go prev` and verifying I ended up in the right spot. Question for reviewer: I don't know if this is relevant to this patch or not but while testing this I would sometimes have this error ```py ./sl Traceback (most recent call last): File "/Users/m0c0j7y/workspace/github.com/facebook/sapling/eden/scm/edenscm/__init__.py", line 86, in run dispatch.runchgserver(args[2:]) File "/Users/m0c0j7y/workspace/github.com/facebook/sapling/eden/scm/edenscm/dispatch.py", line 368, in runchgserver _preimportmodules() File "/Users/m0c0j7y/workspace/github.com/facebook/sapling/eden/scm/edenscm/dispatch.py", line 348, in _preimportmodules extensions.preimport(extname) File "/Users/m0c0j7y/workspace/github.com/facebook/sapling/eden/scm/edenscm/extensions.py", line 208, in preimport mod = getattr(__import__("edenscm.ext.%s" % name).ext, name) File "/Users/m0c0j7y/workspace/github.com/facebook/sapling/eden/scm/edenscm/ext/copytrace.py", line 169, in <module> ) -> Tuple[Optional[dbm._Database], Optional[Tuple[Type[dbm._error], Type[OSError]]]]: AttributeError: module 'dbm' has no attribute '_Database' ``` and other times I would get this warning ```python CHGDISABLE=1 ./sl go prev Traceback (most recent call last): File "/Users/m0c0j7y/workspace/github.com/facebook/sapling/eden/scm/edenscm/extensions.py", line 399, in _runextsetup extsetup(ui) File "/Users/m0c0j7y/workspace/github.com/facebook/sapling/eden/scm/edenscm/ext/copytrace.py", line 113, in extsetup extensions.wrapfunction(copiesmod, "mergecopies", _mergecopies) NameError: name '_mergecopies' is not defined warning: failed to set up extension copytrace: name '_mergecopies' is not defined 1 files updated, 0 files merged, 0 files removed, 0 files unresolved ```
Oh wow! I never realized that |
vegerot
added a commit
to vegerot/sapling
that referenced
this issue
Jan 13, 2023
Summary: In the same way you can `sl go top`, it seems logical to also have `sl go next`. However, instead it is `sl next`. While I normally remember to do `sl prev`, I sometimes accidentally do `sl go prev` out of habbit and get an error. Instead, let's simply add two revset aliases for `next` and `prev` to make sl more intuitive. Differences from `sl next/prev`: - Cannot specify number of commits: `sl prev 2` works but `sl goto prev 2` doesn't. (but `sl go prev~1` would) - Handles merge commits differently. No interactive selection and no `sl next --newest` Closes facebook#444 Test Plan: Automated tested blocked on facebook#447 Manually tested by running `sl go next` and `sl go prev` and verifying I ended up in the right spot. Question for reviewer: I don't know if this is relevant to this patch or not but while testing this I would sometimes have this error ```py ./sl Traceback (most recent call last): File "/Users/m0c0j7y/workspace/github.com/facebook/sapling/eden/scm/edenscm/__init__.py", line 86, in run dispatch.runchgserver(args[2:]) File "/Users/m0c0j7y/workspace/github.com/facebook/sapling/eden/scm/edenscm/dispatch.py", line 368, in runchgserver _preimportmodules() File "/Users/m0c0j7y/workspace/github.com/facebook/sapling/eden/scm/edenscm/dispatch.py", line 348, in _preimportmodules extensions.preimport(extname) File "/Users/m0c0j7y/workspace/github.com/facebook/sapling/eden/scm/edenscm/extensions.py", line 208, in preimport mod = getattr(__import__("edenscm.ext.%s" % name).ext, name) File "/Users/m0c0j7y/workspace/github.com/facebook/sapling/eden/scm/edenscm/ext/copytrace.py", line 169, in <module> ) -> Tuple[Optional[dbm._Database], Optional[Tuple[Type[dbm._error], Type[OSError]]]]: AttributeError: module 'dbm' has no attribute '_Database' ``` and other times I would get this warning ```python CHGDISABLE=1 ./sl go prev Traceback (most recent call last): File "/Users/m0c0j7y/workspace/github.com/facebook/sapling/eden/scm/edenscm/extensions.py", line 399, in _runextsetup extsetup(ui) File "/Users/m0c0j7y/workspace/github.com/facebook/sapling/eden/scm/edenscm/ext/copytrace.py", line 113, in extsetup extensions.wrapfunction(copiesmod, "mergecopies", _mergecopies) NameError: name '_mergecopies' is not defined warning: failed to set up extension copytrace: name '_mergecopies' is not defined 1 files updated, 0 files merged, 0 files removed, 0 files unresolved ```
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have found myself trying to run
sl goto --bottom
andsl goto --top
a few times. I know--bottom
and--top
are supposed to be used withnext
andprev
, but my fingers do the typing, not my brain.I would argue that for consistency, having a single top-level gateway into moving the current tip would be preferable:
I also know that currently, nothing prevents a bookmark from being named
top
,bottom
,next
orprev
. Those would have to become reserved words in bookmarks.What do you think?
The text was updated successfully, but these errors were encountered: