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

Add single argument form of diff.namespace #2303

Merged
merged 5 commits into from
Aug 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion parser-typechecker/src/Unison/CommandLine/InputPatterns.hs
Original file line number Diff line number Diff line change
Expand Up @@ -926,19 +926,26 @@ diffNamespace :: InputPattern
diffNamespace = InputPattern
"diff.namespace"
[]
[(Required, pathArg), (Required, pathArg)]
[(Required, pathArg), (Optional, pathArg)]
(P.column2
[ ( "`diff.namespace before after`"
, P.wrap
"shows how the namespace `after` differs from the namespace `before`"
)
, ( "`diff.namespace before`"
, P.wrap
"shows how the current namespace differs from the namespace `before`"
)
]
)
(\case
[before, after] -> first fromString $ do
before <- Path.parsePath' before
after <- Path.parsePath' after
pure $ Input.DiffNamespaceI before after
[before] -> first fromString $ do
before <- Path.parsePath' before
pure $ Input.DiffNamespaceI before Path.currentPath
_ -> Left $ I.help diffNamespace
)

Expand Down
1 change: 1 addition & 0 deletions unison-src/transcripts/diff.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ fslkdjflskdjflksjdf = 663
.b0> add
.> merge b0 b1
.> diff.namespace b1 b2
.b2> diff.namespace .b1
```
Things we want to test:

Expand Down
16 changes: 16 additions & 0 deletions unison-src/transcripts/diff.output.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,22 @@ fslkdjflskdjflksjdf = 663
6. fslkdjflskdjflksjdf#4kipsv2tm6 ┘ 7. fslkdjflskdjflksjdf (added)
8. fslkdjflskdjflksjdf#4kipsv2tm6 (removed)

.b2> diff.namespace .b1

Resolved name conflicts:

1. ┌ fslkdjflskdjflksjdf#4kipsv2tm6 : Nat
2. └ fslkdjflskdjflksjdf#s5tu4n7rlb : Nat
3. fslkdjflskdjflksjdf#4kipsv2tm6 : Nat

Name changes:

Original Changes
4. x ┐ 5. abc (added)
6. fslkdjflskdjflksjdf#4kipsv2tm6 ┘ 7. fslkdjflskdjflksjdf (added)
8. fslkdjflskdjflksjdf#4kipsv2tm6 (removed)

```
Things we want to test:

Expand Down