Skip to content
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

Cannot run tests locally #447

Open
vegerot opened this issue Jan 11, 2023 · 2 comments
Open

Cannot run tests locally #447

vegerot opened this issue Jan 11, 2023 · 2 comments

Comments

@vegerot
Copy link
Contributor

vegerot commented Jan 11, 2023

When trying to run or add tests, I run into a variety of errors. Many of which reference fb tools, meaning that the test suite likely is not set up to be run outside of Meta.

I'll post more details about the tests and the errors later 🙂

vegerot added a commit to vegerot/sapling that referenced this issue Jan 11, 2023
Summary: Instead of just showing `?` or `*`, show one of each symbol in the
dirty status.  This means there will be a maximum of 5 characters at the end of
the prompt, which is fine.

Test Plan: blocked by facebook#447

Question for reviewer: I am having trouble running the test suite for Sapling.
I'd appreciate some help getting this working.  I can provide more details if
you wouldn't mind helping
vegerot added a commit to vegerot/sapling that referenced this issue Jan 11, 2023
Summary: Add shell prompt for Sapling.  The current prompt only supports git
and hg, but not sl.  Since the `hg` prompt should work the same for `sl`, use
`_hg_prompt` for Sapling if a `.sl` directory exists

Test Plan: Blocked by facebook#447
TODO: copy `.hg` testcases from `eden/scm/tests/test-fb-ext-scm-prompt-hg.t`
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
```
vegerot added a commit to vegerot/sapling that referenced this issue Jan 12, 2023
Summary: Make completion work for `sl` by replacing `hg`->`sl` 😁

Test Plan: TODO, blocked by facebook#447

Question for Review: I am having trouble running Sapling's test suite.  I'd
appreciate some assistance here
vegerot added a commit to vegerot/sapling that referenced this issue Jan 12, 2023
Summary: Currently, following the recommended documentation for building
Sapling will always set the sapling version to the upstream Mercurial version
(which has been 4.4.2 for years)

```sh
❯ sl --version
Sapling 4.4.2
```

This isn't very useful when debugging Sapling, and is inconsistenct with the
distributed versions of sl.  This commit aligns the sl version with the sl
version in the distributed versions of sl

Test Plan: Automated testing blocked on facebook#447. Manually tested

```sh
❯ (cd eden/scm && make oss && ./sl --version)
Sapling 0.2.20230107-190820-h75ace1ad
```
vegerot added a commit to vegerot/sapling that referenced this issue Jan 12, 2023
Summary: Currently, tag-name.sh only works with git.  This is fine, because
it's only used in GitHub CI, but I also want to use this script for local
builds (which will be in a future commit).  This commit will use either sl or
git for creating tag names.

Test-Plan: Automated testing blocked on facebook#447

```sh
❯ ./ci/tag-name.sh
0.2.20230107-190233-hc1336fcb
```
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
```
@strager
Copy link
Contributor

strager commented Jan 14, 2023

#458 should help some.

vegerot added a commit to vegerot/sapling that referenced this issue Jan 16, 2023
Summary: Currently, running `sl init --git` for a nonempty directory gives the
follwing error:
```
destination <..> already exists
```
This seems like an arbitary restriction to me, so I removed it.
I would appreciate any explanation for why this restriction was put in place

Test plan: Blocked by facebook#447
manually tested
vegerot added a commit to vegerot/sapling that referenced this issue Jan 16, 2023
Summary: Currently, running `sl init --git` for a nonempty directory gives the
follwing error:
```
destination <..> already exists
```
This seems like an arbitary restriction to me, so I removed it.
I would appreciate any explanation for why this restriction was put in place

Also, this commit fixes an imprecise error message when `init`ing a repository
in a non-directory (i.e. a file)

Test plan: Blocked by facebook#447
manually tested
vegerot added a commit to vegerot/sapling that referenced this issue Jan 16, 2023
Summary: Currently, running `sl init --git` for a nonempty directory gives the
follwing error:
```
destination <..> already exists
```
This seems like an arbitary restriction to me, so I removed it.

It looks like this restriction was put in place because `sl init` and
`sl clone` share similar logic.  Is there any other reason for not allowing
`sl init` in non-empty directories?

Also, this commit fixes an imprecise error message when `init`ing a repository
in a non-directory (i.e. a file)

Test plan: Blocked by facebook#447
manually tested with

(should pass, but didn't before)
```sh
DIR=/tmp/sl-clone-test zsh -c 'rm -rf $DIR; mkdir $DIR && cd $DIR && touch hi && CHGDISABLE=1 sl init --git .'
```

(should still fail)
```sh
DIR=/tmp/sl-clone-test REPO=git@github.com:97-things/97-things-every-programmer-should-know.git zsh -c 'rm -rf $DIR; mkdir $DIR && cd $DIR && CHGDISABLE=1 sl clone $REPO && CHGDISABLE=1 sl clone $REPO'
```
vegerot added a commit to vegerot/sapling that referenced this issue Jan 16, 2023
Summary: Currently, running `sl init --git` for a nonempty directory gives the
follwing error:
```
destination <..> already exists
```
This seems like an arbitary restriction to me, so I removed it.

It looks like this restriction was put in place because `sl init` and
`sl clone` share similar logic.  Is there any other reason for not allowing
`sl init` in non-empty directories?

Also, this commit fixes an imprecise error message when `init`ing a repository
in a non-directory (i.e. a file)

Test plan: Blocked by facebook#447
manually tested with

(should pass, but didn't before)
```sh
DIR=/tmp/sl-clone-test zsh -c 'rm -rf $DIR; mkdir $DIR && cd $DIR && touch hi && CHGDISABLE=1 sl init --git .'
```

(should still fail)
```sh
DIR=/tmp/sl-clone-test REPO=git@github.com:97-things/97-things-every-programmer-should-know.git zsh -c 'rm -rf $DIR; mkdir $DIR && cd $DIR && CHGDISABLE=1 sl clone $REPO && CHGDISABLE=1 sl clone $REPO'
```
vegerot added a commit to vegerot/sapling that referenced this issue Jan 16, 2023
Summary: Currently, running `sl init --git` for a nonempty directory gives the
follwing error:
```
destination <..> already exists
```
This seems like an arbitary restriction to me, so I removed it.

It looks like this restriction was put in place because `sl init` and
`sl clone` share similar logic.  Is there any other reason for not allowing
`sl init` in non-empty directories?

Also, this commit fixes an imprecise error message when `init`ing a repository
in a non-directory (i.e. a file)

Test plan: Blocked by facebook#447
manually tested with

(should pass, but didn't before)
```sh
DIR=/tmp/sl-clone-test zsh -c 'rm -rf $DIR; mkdir $DIR && cd $DIR && touch hi && CHGDISABLE=1 sl init --git .'
```

(should still fail)
```sh
DIR=/tmp/sl-clone-test REPO=git@github.com:97-things/97-things-every-programmer-should-know.git zsh -c 'rm -rf $DIR; mkdir $DIR && cd $DIR && CHGDISABLE=1 sl clone $REPO && CHGDISABLE=1 sl clone $REPO'
```
vegerot added a commit to vegerot/sapling that referenced this issue Jan 19, 2023
Summary: Instead of just showing `?` or `*`, show one of each symbol in the
dirty status.  This means there will be a maximum of 5 characters at the end of
the prompt, which is fine.

Test Plan: blocked by facebook#447

Question for reviewer: I am having trouble running the test suite for Sapling.
I'd appreciate some help getting this working.  I can provide more details if
you wouldn't mind helping
vegerot added a commit to vegerot/sapling that referenced this issue Jan 19, 2023
Summary: Add shell prompt for Sapling.  The current prompt only supports git
and hg, but not sl.  Since the `hg` prompt should work the same for `sl`, use
`_hg_prompt` for Sapling if a `.sl` directory exists

Test Plan: Blocked by facebook#447
TODO: copy `.hg` testcases from `eden/scm/tests/test-fb-ext-scm-prompt-hg.t`
facebook-github-bot pushed a commit that referenced this issue Jan 19, 2023
Summary:
(build): Support sapling in tag-name.sh

 Currently, tag-name.sh only works with git.  This is fine, because
it's only used in GitHub CI, but I also want to use this script for local
builds (which will be in a future commit).  This commit will use either sl or
git for creating tag names.

Test-Plan: Automated testing blocked on #447

```sh
❯ ./ci/tag-name.sh
0.2.20230107-190233-hc1336fcb
```

 ---
Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/facebook/sapling/pull/439).
* #440
* __->__ #439

Pull Request resolved: #439

Reviewed By: quark-zju

Differential Revision: D42611397

Pulled By: bolinfest

fbshipit-source-id: d182ae3027ca72933aa2f4118e12d3e04453dec1
vegerot added a commit to vegerot/sapling that referenced this issue Feb 5, 2023
Summary: Make completion work for `sl` by adding `sl=hg` to the compdef

Test Plan: TODO, blocked by facebook#447

Question for Review: I am having trouble running Sapling's test suite.  I'd
appreciate some assistance here
vegerot added a commit to vegerot/sapling that referenced this issue Feb 5, 2023
Summary: Make completion work for `sl` by adding `sl=hg` to the compdef

Test Plan:
```sh
$ ln -sv ~+/eden/scm/contrib/zsh_completion /usr/local/share/zsh/site-functions
$ exec zsh # might have to clear compinit cache
$ sl g
gc       githelp  goto     graft    grep
```

automated tests blocked by facebook#447

Question for Review: I am having trouble running Sapling's test suite.  I'd
appreciate some assistance here
vegerot added a commit to vegerot/sapling that referenced this issue Feb 5, 2023
Summary: Make completion work for `sl` by adding `sl=hg` to the compdef

Test Plan:
Manually
```sh
$ ln -sv ~+/eden/scm/contrib/zsh_completion /usr/local/share/zsh/site-functions
$ exec zsh # might have to clear compinit cache
$ sl g
gc       githelp  goto     graft    grep
```
(and this does not work on main at the time of writing)


Automated tests blocked by blocked by facebook#447

Question for Review: I am having trouble running Sapling's test suite.  I'd
appreciate some assistance here

off-topic: I can run the unit tests for completion, but I get the same result
on main and this commit, meaning the results are not relevant

```sh
$ (cd tests && python run-tests.py test-completion.t)
```

```diff
--- test-completion.t
+++ test-completion.t.err
@@ -19,6 +19,7 @@
   clean
   clone
   commit
+  config
   configfile
   continue
   copy
@@ -30,6 +31,7 @@
   fs
   gc
   githelp
+  goto
   graft
   grep
   heads
@@ -68,7 +70,6 @@
   unbundle
   uncommit
   uncopy -  update
   verify
   verifyremotefilelog
   version
@@ -107,7 +108,6 @@
   debugcommands
   debugcompactmetalog
   debugcomplete
-  debugconfig
   debugcreatestreamclonebundle
   debugdag
   debugdata
@@ -317,7 +317,6 @@

 Show aliases with -v
   $ hg debugcomplete update -v
-  update checkout co goto

   $ hg debugcomplete -v
   add
@@ -327,13 +326,14 @@
   backout
   bisect
   blackbox
-  bookmark bookmarks
+  bookmark
   branch
   bundle
   cat
   clean purge
   clone
   commit ci
+  config
   configfile
   continue
   copy cp
@@ -345,6 +345,7 @@
   fs
   gc
   githelp
+  goto
   graft
   grep
   heads
@@ -355,7 +356,7 @@
   import patch
   init
   locate
-  log history
+  log
   manifest
   merge
   parents
@@ -383,7 +384,6 @@
   unbundle
   uncommit
   uncopy
-  update checkout co goto
   verify
   verifyremotefilelog
   version
@@ -393,7 +393,7 @@
 Show an error if we use --options with an ambiguous abbreviation
   $ hg debugcomplete --options s
   unknown command 's'
-  (use 'hg help' to get help)
+  (use 'sl help' to get help)
   [255]

 Show all commands + options
@@ -547,6 +547,7 @@
   fs:
   gc:
   githelp:
+  goto: clean, check, merge, date, rev, inactive, continue, tool
   graft: rev, continue, abort, edit, log, force, currentdate, currentuser, date, user, tool, dry-run
   grep: after-context, before-context, context, ignore-case, files-with-matches, line-number, invert-match, word-regexp, extended-regexp, fixed-strings, perl-regexp, include, exclude
   heads: rev, topo, active, closed, style, template
@@ -585,7 +586,6 @@
   unbundle: update
   uncommit: keep, include, exclude
   uncopy: include, exclude, dry-run
-  update: clean, check, merge, date, rev, inactive, continue, tool
   verify: rev, dag
   verifyremotefilelog: decompress
   version: template

ERROR: test-completion.t output changed

----------------------------------------------------------------------
Failed 1 tests (output changed and returned error code 1):
  test-completion.t

# Ran 1 tests, 0 skipped, 1 failed.
python hash seed: 2485669182
```
vegerot added a commit to vegerot/sapling that referenced this issue Feb 5, 2023
Summary: Make completion work for `sl` by adding `sl=hg` to the compdef

Test Plan:
Manually
```sh
$ ln -sv ~+/eden/scm/contrib/zsh_completion /usr/local/share/zsh/site-functions
$ exec zsh # might have to clear compinit cache
$ sl g
gc       githelp  goto     graft    grep
```
(and this does not work on main at the time of writing)


Automated tests blocked by blocked by facebook#447

Question for Review: I am having trouble running Sapling's test suite.  I'd
appreciate some assistance here

off-topic: I can run the unit tests for completion, but because of how
sapling's test runner works I get the same result on main and this commit,
meaning the results are not relevant

```sh
$ (cd tests && python run-tests.py test-completion.t)
```

```diff
--- test-completion.t
+++ test-completion.t.err
@@ -19,6 +19,7 @@
   clean
   clone
   commit
+  config
   configfile
   continue
   copy
@@ -30,6 +31,7 @@
   fs
   gc
   githelp
+  goto
   graft
   grep
   heads
@@ -68,7 +70,6 @@
   unbundle
   uncommit
   uncopy -  update
   verify
   verifyremotefilelog
   version
@@ -107,7 +108,6 @@
   debugcommands
   debugcompactmetalog
   debugcomplete
-  debugconfig
   debugcreatestreamclonebundle
   debugdag
   debugdata
@@ -317,7 +317,6 @@

 Show aliases with -v
   $ hg debugcomplete update -v
-  update checkout co goto

   $ hg debugcomplete -v
   add
@@ -327,13 +326,14 @@
   backout
   bisect
   blackbox
-  bookmark bookmarks
+  bookmark
   branch
   bundle
   cat
   clean purge
   clone
   commit ci
+  config
   configfile
   continue
   copy cp
@@ -345,6 +345,7 @@
   fs
   gc
   githelp
+  goto
   graft
   grep
   heads
@@ -355,7 +356,7 @@
   import patch
   init
   locate
-  log history
+  log
   manifest
   merge
   parents
@@ -383,7 +384,6 @@
   unbundle
   uncommit
   uncopy
-  update checkout co goto
   verify
   verifyremotefilelog
   version
@@ -393,7 +393,7 @@
 Show an error if we use --options with an ambiguous abbreviation
   $ hg debugcomplete --options s
   unknown command 's'
-  (use 'hg help' to get help)
+  (use 'sl help' to get help)
   [255]

 Show all commands + options
@@ -547,6 +547,7 @@
   fs:
   gc:
   githelp:
+  goto: clean, check, merge, date, rev, inactive, continue, tool
   graft: rev, continue, abort, edit, log, force, currentdate, currentuser, date, user, tool, dry-run
   grep: after-context, before-context, context, ignore-case, files-with-matches, line-number, invert-match, word-regexp, extended-regexp, fixed-strings, perl-regexp, include, exclude
   heads: rev, topo, active, closed, style, template
@@ -585,7 +586,6 @@
   unbundle: update
   uncommit: keep, include, exclude
   uncopy: include, exclude, dry-run
-  update: clean, check, merge, date, rev, inactive, continue, tool
   verify: rev, dag
   verifyremotefilelog: decompress
   version: template

ERROR: test-completion.t output changed

----------------------------------------------------------------------
Failed 1 tests (output changed and returned error code 1):
  test-completion.t

# Ran 1 tests, 0 skipped, 1 failed.
python hash seed: 2485669182
```
vegerot added a commit to vegerot/sapling that referenced this issue Feb 5, 2023
Summary: Make completion work for `sl` by adding `sl=hg` to the compdef

Test Plan:
Manually
```sh
$ ln -sv ~+/eden/scm/contrib/zsh_completion /usr/local/share/zsh/site-functions
$ exec zsh # might have to clear compinit cache
$ sl g
gc       githelp  goto     graft    grep
```
(and this does not work on main at the time of writing)


Automated tests blocked by facebook#447

Question for Review: I am having trouble running Sapling's test suite.  I'd
appreciate some assistance here

off-topic: I can run the unit tests for completion, but because of how
sapling's test runner works I get the same result on main and this commit,
meaning the results are not relevant

```sh
$ (cd tests && python run-tests.py test-completion.t)
```

```diff
--- test-completion.t
+++ test-completion.t.err
@@ -19,6 +19,7 @@
   clean
   clone
   commit
+  config
   configfile
   continue
   copy
@@ -30,6 +31,7 @@
   fs
   gc
   githelp
+  goto
   graft
   grep
   heads
@@ -68,7 +70,6 @@
   unbundle
   uncommit
   uncopy -  update
   verify
   verifyremotefilelog
   version
@@ -107,7 +108,6 @@
   debugcommands
   debugcompactmetalog
   debugcomplete
-  debugconfig
   debugcreatestreamclonebundle
   debugdag
   debugdata
@@ -317,7 +317,6 @@

 Show aliases with -v
   $ hg debugcomplete update -v
-  update checkout co goto

   $ hg debugcomplete -v
   add
@@ -327,13 +326,14 @@
   backout
   bisect
   blackbox
-  bookmark bookmarks
+  bookmark
   branch
   bundle
   cat
   clean purge
   clone
   commit ci
+  config
   configfile
   continue
   copy cp
@@ -345,6 +345,7 @@
   fs
   gc
   githelp
+  goto
   graft
   grep
   heads
@@ -355,7 +356,7 @@
   import patch
   init
   locate
-  log history
+  log
   manifest
   merge
   parents
@@ -383,7 +384,6 @@
   unbundle
   uncommit
   uncopy
-  update checkout co goto
   verify
   verifyremotefilelog
   version
@@ -393,7 +393,7 @@
 Show an error if we use --options with an ambiguous abbreviation
   $ hg debugcomplete --options s
   unknown command 's'
-  (use 'hg help' to get help)
+  (use 'sl help' to get help)
   [255]

 Show all commands + options
@@ -547,6 +547,7 @@
   fs:
   gc:
   githelp:
+  goto: clean, check, merge, date, rev, inactive, continue, tool
   graft: rev, continue, abort, edit, log, force, currentdate, currentuser, date, user, tool, dry-run
   grep: after-context, before-context, context, ignore-case, files-with-matches, line-number, invert-match, word-regexp, extended-regexp, fixed-strings, perl-regexp, include, exclude
   heads: rev, topo, active, closed, style, template
@@ -585,7 +586,6 @@
   unbundle: update
   uncommit: keep, include, exclude
   uncopy: include, exclude, dry-run
-  update: clean, check, merge, date, rev, inactive, continue, tool
   verify: rev, dag
   verifyremotefilelog: decompress
   version: template

ERROR: test-completion.t output changed

----------------------------------------------------------------------
Failed 1 tests (output changed and returned error code 1):
  test-completion.t

# Ran 1 tests, 0 skipped, 1 failed.
python hash seed: 2485669182
```
facebook-github-bot pushed a commit that referenced this issue Feb 15, 2023
Summary:
util: add zsh prompt

 Add shell prompt for Sapling.  The current prompt only supports git
and hg, but not sl.  Since the `hg` prompt should work the same for `sl`, use
`_hg_prompt` for Sapling if a `.sl` directory exists

Pull Request resolved: #348

Test Plan:
Blocked by #447
TODO: copy `.hg` testcases from `eden/scm/tests/test-fb-ext-scm-prompt-hg.t`

 ---
Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/facebook/sapling/pull/348).
* #349
* __->__ #348

Reviewed By: genevievehelsel

Differential Revision: D43326422

Pulled By: quark-zju

fbshipit-source-id: 3ceaf037ce62a06455c60a7e3669ec99c9428c5d
facebook-github-bot pushed a commit that referenced this issue Feb 17, 2023
Summary:
Allow `sl init --git` in non-empty directory

 Currently, running `sl init --git` for a nonempty directory gives the
follwing error:
```
destination <..> already exists
```
This seems like an arbitary restriction to me, so I removed it.

It looks like this restriction was put in place because `sl init` and
`sl clone` share similar logic.  Is there any other reason for not allowing
`sl init` in non-empty directories?

Also, this commit fixes an imprecise error message when `init`ing a repository
in a non-directory (i.e. a file)

Pull Request resolved: #463

Test Plan:
Blocked by #447
manually tested with

(should pass, but didn't before)
```sh
DIR=/tmp/sl-clone-test zsh -c 'rm -rf $DIR; mkdir $DIR && cd $DIR && touch hi && CHGDISABLE=1 sl init --git .'
```

(should still fail)
```sh
DIR=/tmp/sl-clone-test REPO=git@github.com:97-things/97-things-every-programmer-should-know.git zsh -c 'rm -rf $DIR; mkdir $DIR && cd $DIR && CHGDISABLE=1 sl clone $REPO && CHGDISABLE=1 sl clone $REPO'
```

 ---
Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/facebook/sapling/pull/463).
* __->__ #463

Reviewed By: muirdm

Differential Revision: D43328481

Pulled By: quark-zju

fbshipit-source-id: 0a82d88c393c847579e644b7c368db09cab51003
facebook-github-bot pushed a commit that referenced this issue Feb 17, 2023
Summary:
feat(scm): Add revset aliases for `next` and `prev`

 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.

The revset functions were added by D43383303.
This change adds convenient aliases so one can use `next`, `prev` without typing `()`:

  next
  prev
  previous

Number of steps can still be specified using the function form:

  next(2)
  prev(3)
  previous(4)

Closes #444

Pull Request resolved: #448

Test Plan:
Automated tested blocked on #447

Manually tested by running `sl go next` and `sl go prev` and verifying I ended
up in the right spot.

Reviewed By: muirdm

Differential Revision: D43329058

Pulled By: quark-zju

fbshipit-source-id: 6fa5c6e6e41971f8f15b784586176b089c5f0027
@vegerot
Copy link
Contributor Author

vegerot commented Apr 13, 2023

tl;dr:
``sh
$ cd tests
$ python run-tests.py test-.t


However, most tests do not pass.  This issue includes trying to make the full test suite pass on the OSS build

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants