rename and hide old merge commands

This commit is contained in:
Mitchell Rosen 2024-04-24 12:29:15 -04:00
parent 240f00dd64
commit d37bce3e7e
38 changed files with 259 additions and 270 deletions

View File

@ -1622,22 +1622,25 @@ pushExhaustive =
branchInclusion = AllBranches
}
squashMerge :: InputPattern
squashMerge =
mergeOldSquashInputPattern :: InputPattern
mergeOldSquashInputPattern =
InputPattern
{ patternName = "merge.squash",
aliases = ["squash"],
visibility = I.Visible,
args = [("namespace or branch to be squashed", Required, namespaceOrProjectBranchArg suggestionsConfig), ("merge destination", Required, namespaceOrProjectBranchArg suggestionsConfig)],
{ patternName = "merge.old.squash",
aliases = ["squash.old"],
visibility = I.Hidden,
args =
[ ("namespace or branch to be squashed", Required, namespaceOrProjectBranchArg suggestionsConfig),
("merge destination", Required, namespaceOrProjectBranchArg suggestionsConfig)
],
help =
P.wrap $
makeExample squashMerge ["src", "dest"]
makeExample mergeOldSquashInputPattern ["src", "dest"]
<> "merges `src` namespace or branch into the `dest` namespace or branch,"
<> "discarding the history of `src` in the process."
<> "The resulting `dest` will have (at most) 1"
<> "additional history entry.",
parse =
maybeToEither (I.help squashMerge) . \case
maybeToEither (I.help mergeOldSquashInputPattern) . \case
[src, dest] -> do
src <- parseLooseCodeOrProject src
dest <- parseLooseCodeOrProject dest
@ -1652,37 +1655,37 @@ squashMerge =
branchInclusion = AllBranches
}
mergeLocal :: InputPattern
mergeLocal =
mergeOldInputPattern :: InputPattern
mergeOldInputPattern =
InputPattern
"merge"
"merge.old"
[]
I.Visible
I.Hidden
[ ("branch or namespace to merge", Required, namespaceOrProjectBranchArg config),
("merge destination", Optional, namespaceOrProjectBranchArg config)
]
( P.column2
[ ( "`merge foo/bar baz/qux`",
[ ( makeExample mergeOldInputPattern ["foo/bar", "baz/qux"],
"merges the `foo/bar` branch into the `baz/qux` branch"
),
( "`merge /topic /main`",
( makeExample mergeOldInputPattern ["/topic", "/main"],
"merges the branch `topic` of the current project into the `main` branch of the current project"
),
( "`merge foo/topic /main`",
( makeExample mergeOldInputPattern ["foo/topic", "/main"],
"merges the branch `topic` of the project `foo` into the `main` branch of the current project"
),
( "`merge /topic foo/main`",
( makeExample mergeOldInputPattern ["/topic", "foo/main"],
"merges the branch `topic` of the current project into the `main` branch of the project 'foo`"
),
( "`merge .src`",
( makeExample mergeOldInputPattern [".src"],
"merges `.src` namespace into the current namespace"
),
( "`merge .src .dest`",
( makeExample mergeOldInputPattern [".src", ".dest"],
"merges `.src` namespace into the `dest` namespace"
)
]
)
( maybeToEither (I.help mergeLocal) . \case
( maybeToEither (I.help mergeOldInputPattern) . \case
[src] -> do
src <- parseLooseCodeOrProject src
Just $ Input.MergeLocalBranchI src (This Path.relativeEmpty') Branch.RegularMerge
@ -1707,7 +1710,7 @@ mergeInputPattern =
aliases = [],
visibility = I.Visible,
args = [],
help = "`merge branch` merges `branch` into the current branch",
help = P.wrap $ makeExample mergeInputPattern ["/branch"] <> "merges `branch` into the current branch",
parse =
\args ->
maybeToEither (I.help mergeInputPattern) do
@ -1736,12 +1739,10 @@ diffNamespace =
[("before namespace", Required, namespaceOrProjectBranchArg suggestionsConfig), ("after namespace", Optional, namespaceOrProjectBranchArg suggestionsConfig)]
( P.column2
[ ( "`diff.namespace before after`",
P.wrap
"shows how the namespace `after` differs from the namespace `before`"
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`"
P.wrap "shows how the current namespace differs from the namespace `before`"
)
]
)
@ -1763,23 +1764,23 @@ diffNamespace =
branchInclusion = AllBranches
}
previewMergeLocal :: InputPattern
previewMergeLocal =
mergeOldPreviewInputPattern :: InputPattern
mergeOldPreviewInputPattern =
InputPattern
"merge.preview"
"merge.old.preview"
[]
I.Visible
I.Hidden
[("branch or namespace to merge", Required, namespaceOrProjectBranchArg suggestionsConfig), ("merge destination", Optional, namespaceOrProjectBranchArg suggestionsConfig)]
( P.column2
[ ( "`merge.preview src`",
"shows how the current namespace will change after a `merge src`."
[ ( makeExample mergeOldPreviewInputPattern ["src"],
"shows how the current namespace will change after a " <> makeExample mergeOldInputPattern ["src"]
),
( "`merge.preview src dest`",
"shows how `dest` namespace will change after a `merge src dest`."
( makeExample mergeOldPreviewInputPattern ["src", "dest"],
"shows how `dest` namespace will change after a " <> makeExample mergeOldInputPattern ["src", "dest"]
)
]
)
( maybeToEither (I.help previewMergeLocal) . \case
( maybeToEither (I.help mergeOldPreviewInputPattern) . \case
[src] -> do
src <- parseLooseCodeOrProject src
pure $ Input.PreviewMergeLocalBranchI src (This Path.relativeEmpty')
@ -2047,8 +2048,7 @@ helpTopicsMap =
"",
P.wrap $
"As a workaround, you can give definitions with a relative name"
<> "temporarily (like `exports.blah.foo`) and then use `move.*` "
<> "or `merge` commands to move stuff around afterwards."
<> "temporarily (like `exports.blah.foo`) and then use `move.*`."
]
remotesMsg =
P.callout "\129302" . P.lines $
@ -2074,7 +2074,7 @@ helpTopicsMap =
(patternName projectsInputPattern, "list all your projects"),
(patternName branchInputPattern, "create a new workstream"),
(patternName branchesInputPattern, "list all your branches"),
(patternName mergeLocal, "merge one branch into another"),
(patternName mergeInputPattern, "merge one branch into another"),
(patternName projectSwitch, "switch to a project or branch"),
(patternName push, "upload your changes to Unison Share"),
(patternName pull, "download code(/changes/updates) from Unison Share"),
@ -3017,14 +3017,15 @@ validInputs =
makeStandalone,
mergeBuiltins,
mergeIOBuiltins,
mergeLocal,
mergeOldInputPattern,
mergeOldPreviewInputPattern,
mergeOldSquashInputPattern,
mergeInputPattern,
names False, -- names
names True, -- names.global
namespaceDependencies,
patch,
previewAdd,
previewMergeLocal,
previewUpdate,
printVersion,
projectCreate,
@ -3052,7 +3053,6 @@ validInputs =
resetRoot,
runScheme,
saveExecuteResult,
squashMerge,
test,
testAll,
todo,
@ -3151,8 +3151,7 @@ namespaceArg =
fzfResolver = Just Resolvers.namespaceResolver
}
-- | Usually you'll want one or the other, but some commands like 'merge' support both right
-- now.
-- | Usually you'll want one or the other, but some commands support both right now.
namespaceOrProjectBranchArg :: ProjectBranchSuggestionsConfig -> ArgumentType
namespaceOrProjectBranchArg config =
ArgumentType

View File

@ -1892,9 +1892,7 @@ notifyUser dir = \case
<> P.newline
<> tip
( "Use"
<> IP.makeExample IP.mergeLocal [prettySlashProjectBranchName (UnsafeProjectBranchName "somebranch")]
<> "or"
<> IP.makeExample IP.mergeLocal [prettyAbsolute (Path.Absolute (Path.fromList ["path", "to", "code"]))]
<> IP.makeExample IP.mergeInputPattern [prettySlashProjectBranchName (UnsafeProjectBranchName "somebranch")]
<> "to initialize this branch."
)
CreatedProjectBranchFrom'OtherBranch (ProjectAndBranch otherProject otherBranch) ->
@ -1918,15 +1916,12 @@ notifyUser dir = \case
<> P.newline
<> P.newline
<> tip
( "Use"
<> IP.makeExample
IP.mergeLocal
[ prettySlashProjectBranchName (projectAndBranch ^. #branch),
prettySlashProjectBranchName parentBranch
]
<> "to merge your work back into the"
( "To merge your work back into the"
<> prettyProjectBranchName parentBranch
<> "branch."
<> "branch, first"
<> IP.makeExample IP.projectSwitch [prettySlashProjectBranchName parentBranch]
<> "then"
<> IP.makeExample IP.mergeInputPattern [prettySlashProjectBranchName (projectAndBranch ^. #branch)]
)
CreatedRemoteProject host (ProjectAndBranch projectName _) ->
pure . P.wrap $

View File

@ -30,85 +30,85 @@ foo/main> branch topic1
Done. I've created the topic1 branch based off of main.
Tip: Use `merge /topic1 /main` to merge your work back into
the main branch.
Tip: To merge your work back into the main branch, first
`switch /main` then `merge2 /topic1`
foo/main> branch /topic2
Done. I've created the topic2 branch based off of main.
Tip: Use `merge /topic2 /main` to merge your work back into
the main branch.
Tip: To merge your work back into the main branch, first
`switch /main` then `merge2 /topic2`
foo/main> branch foo/topic3
Done. I've created the topic3 branch based off of main.
Tip: Use `merge /topic3 /main` to merge your work back into
the main branch.
Tip: To merge your work back into the main branch, first
`switch /main` then `merge2 /topic3`
foo/main> branch main topic4
Done. I've created the topic4 branch based off of main.
Tip: Use `merge /topic4 /main` to merge your work back into
the main branch.
Tip: To merge your work back into the main branch, first
`switch /main` then `merge2 /topic4`
foo/main> branch main /topic5
Done. I've created the topic5 branch based off of main.
Tip: Use `merge /topic5 /main` to merge your work back into
the main branch.
Tip: To merge your work back into the main branch, first
`switch /main` then `merge2 /topic5`
foo/main> branch main foo/topic6
Done. I've created the topic6 branch based off of main.
Tip: Use `merge /topic6 /main` to merge your work back into
the main branch.
Tip: To merge your work back into the main branch, first
`switch /main` then `merge2 /topic6`
foo/main> branch /main topic7
Done. I've created the topic7 branch based off of main.
Tip: Use `merge /topic7 /main` to merge your work back into
the main branch.
Tip: To merge your work back into the main branch, first
`switch /main` then `merge2 /topic7`
foo/main> branch /main /topic8
Done. I've created the topic8 branch based off of main.
Tip: Use `merge /topic8 /main` to merge your work back into
the main branch.
Tip: To merge your work back into the main branch, first
`switch /main` then `merge2 /topic8`
foo/main> branch /main foo/topic9
Done. I've created the topic9 branch based off of main.
Tip: Use `merge /topic9 /main` to merge your work back into
the main branch.
Tip: To merge your work back into the main branch, first
`switch /main` then `merge2 /topic9`
foo/main> branch foo/main topic10
Done. I've created the topic10 branch based off of main.
Tip: Use `merge /topic10 /main` to merge your work back into
the main branch.
Tip: To merge your work back into the main branch, first
`switch /main` then `merge2 /topic10`
foo/main> branch foo/main /topic11
Done. I've created the topic11 branch based off of main.
Tip: Use `merge /topic11 /main` to merge your work back into
the main branch.
Tip: To merge your work back into the main branch, first
`switch /main` then `merge2 /topic11`
.> branch foo/main foo/topic12
Done. I've created the topic12 branch based off of main.
Tip: Use `merge /topic12 /main` to merge your work back into
the main branch.
Tip: To merge your work back into the main branch, first
`switch /main` then `merge2 /topic12`
foo/main> branch bar/topic
@ -150,29 +150,25 @@ foo/main> branch.empty empty1
Done. I've created an empty branch foo/empty1.
Tip: Use `merge /somebranch` or `merge .path.to.code` to
initialize this branch.
Tip: Use `merge2 /somebranch` to initialize this branch.
foo/main> branch.empty /empty2
Done. I've created an empty branch foo/empty2.
Tip: Use `merge /somebranch` or `merge .path.to.code` to
initialize this branch.
Tip: Use `merge2 /somebranch` to initialize this branch.
foo/main> branch.empty foo/empty3
Done. I've created an empty branch foo/empty3.
Tip: Use `merge /somebranch` or `merge .path.to.code` to
initialize this branch.
Tip: Use `merge2 /somebranch` to initialize this branch.
.> branch.empty foo/empty4
Done. I've created an empty branch foo/empty4.
Tip: Use `merge /somebranch` or `merge .path.to.code` to
initialize this branch.
Tip: Use `merge2 /somebranch` to initialize this branch.
```
The `branch` command can create branches named `releases/drafts/*` (because why not).
@ -183,8 +179,8 @@ foo/main> branch releases/drafts/1.2.3
Done. I've created the releases/drafts/1.2.3 branch based off
of main.
Tip: Use `merge /releases/drafts/1.2.3 /main` to merge your
work back into the main branch.
Tip: To merge your work back into the main branch, first
`switch /main` then `merge2 /releases/drafts/1.2.3`
foo/main> switch /releases/drafts/1.2.3

View File

@ -1,8 +1,8 @@
# Behaviour of namespace histories during a merge.
Note: This is a descriptive test meant to capture the current behaviour of
Note: This is a descriptive test meant to capture the current behaviour of
branch histories during a merge.
It isn't prescriptive about how merges _should_ work with respect to child branches,
It isn't prescriptive about how merges _should_ work with respect to child branches,
but I think we should at least notice if we change things by accident.
@ -69,7 +69,7 @@ Split off two separate forks, one for testing squash merges, one for standard me
For a squash merge, when I squash-merge back into parent, we expect `parent_fork.child.thing3` to be added.
```ucm
.> merge.squash parent_fork parent_squash_base
.> merge.old.squash parent_fork parent_squash_base
.> history parent_squash_base
```
@ -86,7 +86,7 @@ Notice that with the current behaviour, the history of `parent.child` is complet
For a standard merge, if I merge back into parent, we expect `parent_fork.child.thing3` to be added.
```ucm
.> merge parent_fork parent_merge_base
.> merge.old parent_fork parent_merge_base
.> history parent_merge_base
```

View File

@ -1,8 +1,8 @@
# Behaviour of namespace histories during a merge.
Note: This is a descriptive test meant to capture the current behaviour of
Note: This is a descriptive test meant to capture the current behaviour of
branch histories during a merge.
It isn't prescriptive about how merges _should_ work with respect to child branches,
It isn't prescriptive about how merges _should_ work with respect to child branches,
but I think we should at least notice if we change things by accident.
@ -125,7 +125,7 @@ Split off two separate forks, one for testing squash merges, one for standard me
For a squash merge, when I squash-merge back into parent, we expect `parent_fork.child.thing3` to be added.
```ucm
.> merge.squash parent_fork parent_squash_base
.> merge.old.squash parent_fork parent_squash_base
Here's what's changed in parent_squash_base after the merge:
@ -210,7 +210,7 @@ Notice that with the current behaviour, the history of `parent.child` is complet
For a standard merge, if I merge back into parent, we expect `parent_fork.child.thing3` to be added.
```ucm
.> merge parent_fork parent_merge_base
.> merge.old parent_fork parent_merge_base
Here's what's changed in parent_merge_base after the merge:

View File

@ -22,8 +22,8 @@ foo/main> branch topic
Done. I've created the topic branch based off of main.
Tip: Use `merge /topic /main` to merge your work back into the
main branch.
Tip: To merge your work back into the main branch, first
`switch /main` then `merge2 /topic`
foo/topic> delete.branch /topic
@ -35,8 +35,8 @@ foo/main> branch topic
Done. I've created the topic branch based off of main.
Tip: Use `merge /topic /main` to merge your work back into the
main branch.
Tip: To merge your work back into the main branch, first
`switch /main` then `merge2 /topic`
foo/topic> delete.branch topic
@ -48,8 +48,8 @@ foo/main> branch topic
Done. I've created the topic branch based off of main.
Tip: Use `merge /topic /main` to merge your work back into the
main branch.
Tip: To merge your work back into the main branch, first
`switch /main` then `merge2 /topic`
☝️ The namespace . is empty.

View File

@ -44,7 +44,7 @@ foo = 2
```ucm
.b> add
.a> merge .b
.a> merge.old .b
```
A delete should remove both versions of the term.
@ -73,7 +73,7 @@ structural type Foo = Foo
```ucm
.b> add
.a> merge .b
.a> merge.old .b
```
```ucm

View File

@ -84,7 +84,7 @@ foo = 2
foo : ##Nat
.a> merge .b
.a> merge.old .b
Here's what's changed in the current namespace after the
merge:
@ -155,7 +155,7 @@ structural type Foo = Foo
structural type Foo
.a> merge .b
.a> merge.old .b
Here's what's changed in the current namespace after the
merge:

View File

@ -22,8 +22,8 @@ two.e = 6
```ucm:hide
.> add
.> merge oneconflicts one
.> merge twoconflicts two
.> merge.old oneconflicts one
.> merge.old twoconflicts two
.> delete.namespace oneconflicts
.> delete.namespace twoconflicts
```

View File

@ -17,7 +17,7 @@ fslkdjflskdjflksjdf = 663
```
```ucm
.b0> add
.> merge b0 b1
.> merge.old b0 b1
.> diff.namespace b1 b2
.b2> diff.namespace .b1
```
@ -67,7 +67,7 @@ fromJust = "asldkfjasldkfj"
```ucm
.ns1b> add
.> merge ns1b ns1
.> merge.old ns1b ns1
```
```unison:hide
@ -126,10 +126,10 @@ a = 555
```
```ucm
.nsz> update.old
.> merge nsy nsw
.> merge.old nsy nsw
```
```ucm:error
.> merge nsz nsw
.> merge.old nsz nsw
```
```ucm
.> diff.namespace nsx nsw

View File

@ -37,7 +37,7 @@ fslkdjflskdjflksjdf = 663
fslkdjflskdjflksjdf : ##Nat
.> merge b0 b1
.> merge.old b0 b1
Here's what's changed in b1 after the merge:
@ -169,7 +169,7 @@ fromJust = "asldkfjasldkfj"
fromJust : ##Text
.> merge ns1b ns1
.> merge.old ns1b ns1
Here's what's changed in ns1 after the merge:
@ -417,7 +417,7 @@ a = 555
a : ##Nat
.> merge nsy nsw
.> merge.old nsy nsw
Here's what's changed in nsw after the merge:
@ -437,7 +437,7 @@ a = 555
```
```ucm
.> merge nsz nsw
.> merge.old nsz nsw
Here's what's changed in nsw after the merge:

View File

@ -32,7 +32,7 @@ Merging an empty namespace should be a no-op
```ucm:error
.empty> history
.empty> merge .mynamespace
.empty> merge.old .mynamespace
.empty> history
```

View File

@ -64,7 +64,7 @@ Merging an empty namespace should be a no-op
☝️ The namespace .empty is empty.
.empty> merge .mynamespace
.empty> merge.old .mynamespace
⚠️

View File

@ -34,10 +34,10 @@ Merge back into the ancestor.
```ucm
.> add
.> merge y.b y.a
.> merge.old y.b y.a
.> delete.term.verbose 1
.> merge y m
.> squash y s
.> merge.old y m
.> merge.old.squash y s
.s> todo
.m> todo
```

View File

@ -104,7 +104,7 @@ Merge back into the ancestor.
y.b.p : Text
.> merge y.b y.a
.> merge.old y.b y.a
Here's what's changed in y.a after the merge:
@ -133,7 +133,7 @@ Merge back into the ancestor.
Tip: You can use `undo` or `reflog` to undo this change.
.> merge y m
.> merge.old y m
Here's what's changed in m after the merge:
@ -155,7 +155,7 @@ Merge back into the ancestor.
Applying changes from patch...
.> squash y s
.> merge.old.squash y s
Here's what's changed in s after the merge:

View File

@ -38,7 +38,7 @@ Now we fork `a2` off of `a`. `a` continues on, deleting the terms it added previ
.> delete.term.verbose a.delete3
.> delete.type.verbose a.Delete4
.> alias.term .builtin.Float.+ newbranchA.dontDelete
.> merge newbranchA a
.> merge.old newbranchA a
.a> find
```
@ -51,14 +51,14 @@ Meanwhile, `a2` adds some other unrelated terms, some via merging in namespaces
.> alias.term builtin.Text.take a2.keep4
.> alias.term builtin.Text.take a2.keep5
.> alias.term builtin.Text.take newbranchA2.keep6
.> merge newbranchA2 a2
.> merge.old newbranchA2 a2
.a2> find
```
```ucm
.> fork a asquash
.> merge a2 a
.> squash a2 asquash
.> merge.old a2 a
.> merge.old.squash a2 asquash
```
At this point, all the things that `a` has deleted (`delete1`, `delete2`, etc) should be deleted in both the merged and squashed results. Let's verify this:

View File

@ -92,7 +92,7 @@ Now we fork `a2` off of `a`. `a` continues on, deleting the terms it added previ
Done.
.> merge newbranchA a
.> merge.old newbranchA a
Here's what's changed in a after the merge:
@ -140,7 +140,7 @@ Meanwhile, `a2` adds some other unrelated terms, some via merging in namespaces
Done.
.> merge newbranchA2 a2
.> merge.old newbranchA2 a2
Here's what's changed in a2 after the merge:
@ -180,7 +180,7 @@ Meanwhile, `a2` adds some other unrelated terms, some via merging in namespaces
Done.
.> merge a2 a
.> merge.old a2 a
Here's what's changed in a after the merge:
@ -200,7 +200,7 @@ Meanwhile, `a2` adds some other unrelated terms, some via merging in namespaces
Applying changes from patch...
.> squash a2 asquash
.> merge.old.squash a2 asquash
Here's what's changed in asquash after the merge:

View File

@ -85,8 +85,8 @@ myproject/main> branch mybranch
Done. I've created the mybranch branch based off of main.
Tip: Use `merge /mybranch /main` to merge your work back into
the main branch.
Tip: To merge your work back into the main branch, first
`switch /main` then `merge2 /mybranch`
.> debug.fuzzy-options switch _

View File

@ -13,8 +13,8 @@ project/main> branch alice
Done. I've created the alice branch based off of main.
Tip: Use `merge /alice /main` to merge your work back into the
main branch.
Tip: To merge your work back into the main branch, first
`switch /main` then `merge2 /alice`
```
```unison
@ -46,8 +46,8 @@ project/main> branch bob
Done. I've created the bob branch based off of main.
Tip: Use `merge /bob /main` to merge your work back into the
main branch.
Tip: To merge your work back into the main branch, first
`switch /main` then `merge2 /bob`
```
```unison
@ -97,8 +97,8 @@ project/main> branch alice
Done. I've created the alice branch based off of main.
Tip: Use `merge /alice /main` to merge your work back into the
main branch.
Tip: To merge your work back into the main branch, first
`switch /main` then `merge2 /alice`
```
```unison
@ -130,8 +130,8 @@ project/main> branch bob
Done. I've created the bob branch based off of main.
Tip: Use `merge /bob /main` to merge your work back into the
main branch.
Tip: To merge your work back into the main branch, first
`switch /main` then `merge2 /bob`
```
```unison
@ -212,8 +212,8 @@ project/main> branch alice
Done. I've created the alice branch based off of main.
Tip: Use `merge /alice /main` to merge your work back into the
main branch.
Tip: To merge your work back into the main branch, first
`switch /main` then `merge2 /alice`
```
```unison
@ -247,8 +247,8 @@ project/main> branch bob
Done. I've created the bob branch based off of main.
Tip: Use `merge /bob /main` to merge your work back into the
main branch.
Tip: To merge your work back into the main branch, first
`switch /main` then `merge2 /bob`
```
```unison
@ -339,8 +339,8 @@ project/main> branch alice
Done. I've created the alice branch based off of main.
Tip: Use `merge /alice /main` to merge your work back into the
main branch.
Tip: To merge your work back into the main branch, first
`switch /main` then `merge2 /alice`
```
```unison
@ -378,8 +378,8 @@ project/main> branch bob
Done. I've created the bob branch based off of main.
Tip: Use `merge /bob /main` to merge your work back into the
main branch.
Tip: To merge your work back into the main branch, first
`switch /main` then `merge2 /bob`
```
```unison
@ -477,8 +477,8 @@ project/main> branch alice
Done. I've created the alice branch based off of main.
Tip: Use `merge /alice /main` to merge your work back into the
main branch.
Tip: To merge your work back into the main branch, first
`switch /main` then `merge2 /alice`
```
```unison
@ -516,8 +516,8 @@ project/main> branch bob
Done. I've created the bob branch based off of main.
Tip: Use `merge /bob /main` to merge your work back into the
main branch.
Tip: To merge your work back into the main branch, first
`switch /main` then `merge2 /bob`
```
```unison
@ -604,8 +604,8 @@ project/main> branch alice
Done. I've created the alice branch based off of main.
Tip: Use `merge /alice /main` to merge your work back into the
main branch.
Tip: To merge your work back into the main branch, first
`switch /main` then `merge2 /alice`
```
```unison
@ -639,8 +639,8 @@ project/main> branch bob
Done. I've created the bob branch based off of main.
Tip: Use `merge /bob /main` to merge your work back into the
main branch.
Tip: To merge your work back into the main branch, first
`switch /main` then `merge2 /bob`
project/bob> delete.term foo
@ -665,15 +665,15 @@ project/main> branch alice
Done. I've created the alice branch based off of main.
Tip: Use `merge /alice /main` to merge your work back into the
main branch.
Tip: To merge your work back into the main branch, first
`switch /main` then `merge2 /alice`
project/main> branch bob
Done. I've created the bob branch based off of main.
Tip: Use `merge /bob /main` to merge your work back into the
main branch.
Tip: To merge your work back into the main branch, first
`switch /main` then `merge2 /bob`
project/alice> merge2 /bob
@ -691,15 +691,15 @@ project/main> branch alice
Done. I've created the alice branch based off of main.
Tip: Use `merge /alice /main` to merge your work back into the
main branch.
Tip: To merge your work back into the main branch, first
`switch /main` then `merge2 /alice`
project/main> branch bob
Done. I've created the bob branch based off of main.
Tip: Use `merge /bob /main` to merge your work back into the
main branch.
Tip: To merge your work back into the main branch, first
`switch /main` then `merge2 /bob`
```
```unison
@ -743,15 +743,15 @@ project/main> branch alice
Done. I've created the alice branch based off of main.
Tip: Use `merge /alice /main` to merge your work back into the
main branch.
Tip: To merge your work back into the main branch, first
`switch /main` then `merge2 /alice`
project/main> branch bob
Done. I've created the bob branch based off of main.
Tip: Use `merge /bob /main` to merge your work back into the
main branch.
Tip: To merge your work back into the main branch, first
`switch /main` then `merge2 /bob`
```
```unison
@ -821,8 +821,8 @@ project/main> branch alice
Done. I've created the alice branch based off of main.
Tip: Use `merge /alice /main` to merge your work back into the
main branch.
Tip: To merge your work back into the main branch, first
`switch /main` then `merge2 /alice`
project/alice> delete.term foo
@ -832,8 +832,8 @@ project/main> branch bob
Done. I've created the bob branch based off of main.
Tip: Use `merge /bob /main` to merge your work back into the
main branch.
Tip: To merge your work back into the main branch, first
`switch /main` then `merge2 /bob`
```
```unison
@ -911,8 +911,8 @@ project/main> branch alice
Done. I've created the alice branch based off of main.
Tip: Use `merge /alice /main` to merge your work back into the
main branch.
Tip: To merge your work back into the main branch, first
`switch /main` then `merge2 /alice`
```
```unison
@ -946,8 +946,8 @@ project/main> branch bob
Done. I've created the bob branch based off of main.
Tip: Use `merge /bob /main` to merge your work back into the
main branch.
Tip: To merge your work back into the main branch, first
`switch /main` then `merge2 /bob`
```
```unison
@ -1029,8 +1029,8 @@ project/main> branch alice
Done. I've created the alice branch based off of main.
Tip: Use `merge /alice /main` to merge your work back into the
main branch.
Tip: To merge your work back into the main branch, first
`switch /main` then `merge2 /alice`
```
```unison
@ -1075,8 +1075,8 @@ project/main> branch bob
Done. I've created the bob branch based off of main.
Tip: Use `merge /bob /main` to merge your work back into the
main branch.
Tip: To merge your work back into the main branch, first
`switch /main` then `merge2 /bob`
```
```unison
@ -1177,8 +1177,8 @@ project/main> branch alice
Done. I've created the alice branch based off of main.
Tip: Use `merge /alice /main` to merge your work back into the
main branch.
Tip: To merge your work back into the main branch, first
`switch /main` then `merge2 /alice`
```
```unison
@ -1211,8 +1211,8 @@ project/main> branch bob
Done. I've created the bob branch based off of main.
Tip: Use `merge /bob /main` to merge your work back into the
main branch.
Tip: To merge your work back into the main branch, first
`switch /main` then `merge2 /bob`
```
```unison
@ -1287,8 +1287,8 @@ project/main> branch alice
Done. I've created the alice branch based off of main.
Tip: Use `merge /alice /main` to merge your work back into the
main branch.
Tip: To merge your work back into the main branch, first
`switch /main` then `merge2 /alice`
```
```unison
@ -1321,8 +1321,8 @@ project/main> branch bob
Done. I've created the bob branch based off of main.
Tip: Use `merge /bob /main` to merge your work back into the
main branch.
Tip: To merge your work back into the main branch, first
`switch /main` then `merge2 /bob`
```
```unison
@ -1402,8 +1402,8 @@ project/main> branch alice
Done. I've created the alice branch based off of main.
Tip: Use `merge /alice /main` to merge your work back into the
main branch.
Tip: To merge your work back into the main branch, first
`switch /main` then `merge2 /alice`
```
```unison
@ -1443,8 +1443,8 @@ project/main> branch bob
Done. I've created the bob branch based off of main.
Tip: Use `merge /bob /main` to merge your work back into the
main branch.
Tip: To merge your work back into the main branch, first
`switch /main` then `merge2 /bob`
```
```unison
@ -1487,8 +1487,8 @@ project/main> branch topic
Done. I've created the topic branch based off of main.
Tip: Use `merge /topic /main` to merge your work back into the
main branch.
Tip: To merge your work back into the main branch, first
`switch /main` then `merge2 /topic`
project/main> alias.type builtin.Nat MyNat
@ -1535,8 +1535,8 @@ project/main> branch topic
Done. I've created the topic branch based off of main.
Tip: Use `merge /topic /main` to merge your work back into the
main branch.
Tip: To merge your work back into the main branch, first
`switch /main` then `merge2 /topic`
```
```unison
@ -1583,8 +1583,8 @@ project/main> branch topic
Done. I've created the topic branch based off of main.
Tip: Use `merge /topic /main` to merge your work back into the
main branch.
Tip: To merge your work back into the main branch, first
`switch /main` then `merge2 /topic`
```
```unison
@ -1629,8 +1629,8 @@ project/main> branch topic
Done. I've created the topic branch based off of main.
Tip: Use `merge /topic /main` to merge your work back into the
main branch.
Tip: To merge your work back into the main branch, first
`switch /main` then `merge2 /topic`
```
```unison
@ -1674,8 +1674,8 @@ project/main> branch topic
Done. I've created the topic branch based off of main.
Tip: Use `merge /topic /main` to merge your work back into the
main branch.
Tip: To merge your work back into the main branch, first
`switch /main` then `merge2 /topic`
```
```unison
@ -1721,8 +1721,8 @@ project/main> branch topic
Done. I've created the topic branch based off of main.
Tip: Use `merge /topic /main` to merge your work back into the
main branch.
Tip: To merge your work back into the main branch, first
`switch /main` then `merge2 /topic`
```
```unison

View File

@ -43,8 +43,8 @@ b = 2
```ucm
.z> add
.> merge x y
.> merge y z
.> merge.old x y
.> merge.old y z
.> history z
```

View File

@ -126,13 +126,13 @@ b = 2
a : ##Nat
b : ##Nat
.> merge x y
.> merge.old x y
Nothing changed as a result of the merge.
Applying changes from patch...
.> merge y z
.> merge.old y z
Nothing changed as a result of the merge.

View File

@ -41,7 +41,7 @@ y = "hello"
```ucm
.feature1> add
.master> merge .feature1
.master> merge.old .feature1
.master> view y
```
@ -49,7 +49,7 @@ y = "hello"
Notice that `master` now has the definition of `y` we wrote.
We can also delete the fork if we're done with it. (Don't worry, even though the history at that path is now empty,
We can also delete the fork if we're done with it. (Don't worry, even though the history at that path is now empty,
it's still in the `history` of the parent namespace and can be resurrected at any time.)
```ucm
@ -99,7 +99,7 @@ master.frobnicate n = n + 1
At this point, `master` and `feature2` both have some changes the other doesn't know about. Let's merge them.
```ucm
.> merge feature2 master
.> merge.old feature2 master
```
Notice that `x` is deleted in the merged branch (it was deleted in `feature2` and untouched by `master`):

View File

@ -76,7 +76,7 @@ y = "hello"
y : ##Text
.master> merge .feature1
.master> merge.old .feature1
Here's what's changed in the current namespace after the
merge:
@ -102,7 +102,7 @@ y = "hello"
Notice that `master` now has the definition of `y` we wrote.
We can also delete the fork if we're done with it. (Don't worry, even though the history at that path is now empty,
We can also delete the fork if we're done with it. (Don't worry, even though the history at that path is now empty,
it's still in the `history` of the parent namespace and can be resurrected at any time.)
```ucm
@ -254,7 +254,7 @@ master.frobnicate n = n + 1
At this point, `master` and `feature2` both have some changes the other doesn't know about. Let's merge them.
```ucm
.> merge feature2 master
.> merge.old feature2 master
Here's what's changed in master after the merge:

View File

@ -52,11 +52,11 @@ d = c + 10
```ucm
.a3> add
.a3> merge .a2 .a3
.a3> merge.old .a2 .a3
```
At this point, `a3` is conflicted for symbols `c` and `d`, so those are deprioritized.
The original `a2` namespace has an unconflicted definition for `c` and `d`, but since there are multiple 'c's in scope,
At this point, `a3` is conflicted for symbols `c` and `d`, so those are deprioritized.
The original `a2` namespace has an unconflicted definition for `c` and `d`, but since there are multiple 'c's in scope,
`a2.c` is chosen because although the suffixified version has fewer segments, its fully-qualified name has the fewest segments.
```ucm
@ -66,7 +66,7 @@ The original `a2` namespace has an unconflicted definition for `c` and `d`, but
## Name biasing
```unison
deeply.nested.term =
deeply.nested.term =
a + 1
deeply.nested.num = 10
@ -76,7 +76,7 @@ a = 10
```ucm
.biasing> add
-- Despite being saved with name `a`,
-- Despite being saved with name `a`,
-- the pretty printer should prefer the suffixified 'deeply.nested.num name' over the shallow 'a'.
-- It's closer to the term being printed.
.biasing> view deeply.nested.term

View File

@ -72,7 +72,7 @@ d = c + 10
c : Nat
d : Nat
.a3> merge .a2 .a3
.a3> merge.old .a2 .a3
Here's what's changed in .a3 after the merge:
@ -101,8 +101,8 @@ d = c + 10
Applying changes from patch...
```
At this point, `a3` is conflicted for symbols `c` and `d`, so those are deprioritized.
The original `a2` namespace has an unconflicted definition for `c` and `d`, but since there are multiple 'c's in scope,
At this point, `a3` is conflicted for symbols `c` and `d`, so those are deprioritized.
The original `a2` namespace has an unconflicted definition for `c` and `d`, but since there are multiple 'c's in scope,
`a2.c` is chosen because although the suffixified version has fewer segments, its fully-qualified name has the fewest segments.
```ucm
@ -138,7 +138,7 @@ The original `a2` namespace has an unconflicted definition for `c` and `d`, but
## Name biasing
```unison
deeply.nested.term =
deeply.nested.term =
a + 1
deeply.nested.num = 10
@ -170,7 +170,7 @@ a = 10
deeply.nested.num : Nat
deeply.nested.term : Nat
-- Despite being saved with name `a`,
-- Despite being saved with name `a`,
-- the pretty printer should prefer the suffixified 'deeply.nested.num name' over the shallow 'a'.
-- It's closer to the term being printed.
.biasing> view deeply.nested.term

View File

@ -11,7 +11,7 @@ zonk = 0
```ucm
.foo> add
.> project.create-empty foo
.> merge foo foo/main
.> merge.old foo foo/main
```
```unison
@ -24,7 +24,7 @@ foo/main> add
```ucm
.> project.create-empty bar
bar/main> merge foo/main
bar/main> merge.old foo/main
bar/main> branch /topic
```
@ -34,6 +34,6 @@ xonk = 1
```ucm
bar/main> add
bar/topic> merge /main
.bar> merge foo/main
bar/topic> merge.old /main
.bar> merge.old foo/main
```

View File

@ -48,7 +48,7 @@ zonk = 0
🎉 🥳 Happy coding!
.> merge foo foo/main
.> merge.old foo foo/main
Here's what's changed in foo/main after the merge:
@ -106,7 +106,7 @@ foo/main> add
🎉 🥳 Happy coding!
bar/main> merge foo/main
bar/main> merge.old foo/main
Here's what's changed in the current namespace after the
merge:
@ -127,8 +127,8 @@ bar/main> branch /topic
Done. I've created the topic branch based off of main.
Tip: Use `merge /topic /main` to merge your work back into the
main branch.
Tip: To merge your work back into the main branch, first
`switch /main` then `merge2 /topic`
```
```unison
@ -155,7 +155,7 @@ bar/main> add
xonk : ##Nat
bar/topic> merge /main
bar/topic> merge.old /main
Here's what's changed in the current namespace after the
merge:
@ -173,7 +173,7 @@ bar/topic> merge /main
☝️ The namespace .bar is empty.
.bar> merge foo/main
.bar> merge.old foo/main
Here's what's changed in the current namespace after the
merge:

View File

@ -152,8 +152,8 @@ foo/main> branch topic
Done. I've created the topic branch based off of main.
Tip: Use `merge /topic /main` to merge your work back into the
main branch.
Tip: To merge your work back into the main branch, first
`switch /main` then `merge2 /topic`
foo/main> history

View File

@ -73,10 +73,10 @@ The `a` and `b` namespaces now each contain a patch named `patch`. We can view t
Let's now merge these namespaces into `c`:
```ucm
.example.resolve> merge a c
.example.resolve> merge.old a c
```
```ucm:error
.example.resolve> merge b c
.example.resolve> merge.old b c
```
The namespace `c` now has an edit conflict, since the term `foo` was edited in two different ways.

View File

@ -136,7 +136,7 @@ The `a` and `b` namespaces now each contain a patch named `patch`. We can view t
Let's now merge these namespaces into `c`:
```ucm
.example.resolve> merge a c
.example.resolve> merge.old a c
Here's what's changed in c after the merge:
@ -159,7 +159,7 @@ Let's now merge these namespaces into `c`:
```
```ucm
.example.resolve> merge b c
.example.resolve> merge.old b c
Here's what's changed in c after the merge:

View File

@ -28,14 +28,14 @@ Now suppose we `fork` a copy of builtin, then rename `Nat.+` to `frobnicate`, th
If we merge that back into `builtin`, we get that same chain of history:
```ucm
.> merge mybuiltin builtin
.> merge.old mybuiltin builtin
.> history builtin
```
Let's try again, but using a `merge.squash` (or just `squash`) instead. The history will be unchanged:
```ucm
.> merge.squash mybuiltin builtin2
.> merge.old.squash mybuiltin builtin2
.> history builtin2
```
@ -92,9 +92,9 @@ At this point, Alice and Bob both have some history beyond what's in trunk:
Alice then squash merges into `trunk`, as does Bob. It's as if Alice and Bob both made their changes in one single commit.
```ucm
.> merge.squash alice trunk
.> merge.old.squash alice trunk
.> history trunk
.> merge.squash bob trunk
.> merge.old.squash bob trunk
.> history trunk
```
@ -109,8 +109,8 @@ Since squash merges don't produce any merge nodes, we can `undo` a couple times
This time, we'll first squash Alice and Bob's changes together before squashing their combined changes into `trunk`. The resulting `trunk` will have just a single entry in it, combining both Alice and Bob's changes:
```ucm
.> squash alice bob
.> squash bob trunk
.> merge.old.squash alice bob
.> merge.old.squash bob trunk
.> history trunk
```
@ -121,7 +121,7 @@ So, there you have it. With squashing, you can control the granularity of your h
Another thing we can do is `squash` into an empty namespace. This effectively makes a copy of the namespace, but without any of its history:
```ucm
.> squash alice nohistoryalice
.> merge.old.squash alice nohistoryalice
.> history nohistoryalice
```
@ -136,7 +136,7 @@ This checks to see that squashing correctly preserves deletions:
.delete> fork builtin builtin2
.delete> delete.term.verbose builtin2.Nat.+
.delete> delete.term.verbose builtin2.Nat.*
.delete> squash builtin2 builtin
.delete> merge.old.squash builtin2 builtin
.delete> history builtin
```

View File

@ -62,7 +62,7 @@ Now suppose we `fork` a copy of builtin, then rename `Nat.+` to `frobnicate`, th
If we merge that back into `builtin`, we get that same chain of history:
```ucm
.> merge mybuiltin builtin
.> merge.old mybuiltin builtin
Nothing changed as a result of the merge.
@ -93,7 +93,7 @@ If we merge that back into `builtin`, we get that same chain of history:
Let's try again, but using a `merge.squash` (or just `squash`) instead. The history will be unchanged:
```ucm
.> merge.squash mybuiltin builtin2
.> merge.old.squash mybuiltin builtin2
Nothing changed as a result of the merge.
@ -239,7 +239,7 @@ At this point, Alice and Bob both have some history beyond what's in trunk:
Alice then squash merges into `trunk`, as does Bob. It's as if Alice and Bob both made their changes in one single commit.
```ucm
.> merge.squash alice trunk
.> merge.old.squash alice trunk
Here's what's changed in trunk after the merge:
@ -269,7 +269,7 @@ Alice then squash merges into `trunk`, as does Bob. It's as if Alice and Bob bot
□ 2. #i52j9fd57b (start of history)
.> merge.squash bob trunk
.> merge.old.squash bob trunk
Here's what's changed in trunk after the merge:
@ -348,7 +348,7 @@ Since squash merges don't produce any merge nodes, we can `undo` a couple times
This time, we'll first squash Alice and Bob's changes together before squashing their combined changes into `trunk`. The resulting `trunk` will have just a single entry in it, combining both Alice and Bob's changes:
```ucm
.> squash alice bob
.> merge.old.squash alice bob
Here's what's changed in bob after the merge:
@ -365,7 +365,7 @@ This time, we'll first squash Alice and Bob's changes together before squashing
Applying changes from patch...
.> squash bob trunk
.> merge.old.squash bob trunk
Here's what's changed in trunk after the merge:
@ -407,7 +407,7 @@ So, there you have it. With squashing, you can control the granularity of your h
Another thing we can do is `squash` into an empty namespace. This effectively makes a copy of the namespace, but without any of its history:
```ucm
.> squash alice nohistoryalice
.> merge.old.squash alice nohistoryalice
Here's what's changed in nohistoryalice after the merge:
@ -472,7 +472,7 @@ This checks to see that squashing correctly preserves deletions:
Tip: You can use `undo` or `reflog` to undo this change.
.delete> squash builtin2 builtin
.delete> merge.old.squash builtin2 builtin
Here's what's changed in builtin after the merge:

View File

@ -30,15 +30,15 @@ foo/main> branch bar
Done. I've created the bar branch based off of main.
Tip: Use `merge /bar /main` to merge your work back into the
main branch.
Tip: To merge your work back into the main branch, first
`switch /main` then `merge2 /bar`
foo/main> branch topic
Done. I've created the topic branch based off of main.
Tip: Use `merge /topic /main` to merge your work back into the
main branch.
Tip: To merge your work back into the main branch, first
`switch /main` then `merge2 /topic`
```
Now, the demo. When unambiguous, `switch` switches to either a project or a branch in the current project. A branch in

View File

@ -197,8 +197,8 @@ myproject/main> branch mybranch
Done. I've created the mybranch branch based off of main.
Tip: Use `merge /mybranch /main` to merge your work back into
the main branch.
Tip: To merge your work back into the main branch, first
`switch /main` then `merge2 /mybranch`
myproject/main> debug.tab-complete branch.delete /mybr
@ -237,7 +237,6 @@ myproject/main> add
myproject/main> debug.tab-complete merge mybr
/mybranch
mybranchsubnamespace
```

View File

@ -74,7 +74,7 @@ type MyType = MyType Int
```
```ucm:error
.mergeA> merge .mergeB
.mergeA> merge.old .mergeB
.mergeA> todo
```

View File

@ -69,7 +69,7 @@ type MyType = MyType Int
```
```ucm
.mergeA> merge .mergeB
.mergeA> merge.old .mergeB
Here's what's changed in the current namespace after the
merge:

View File

@ -13,8 +13,8 @@ b.x = 2
Cause a conflict:
```ucm
.> add
.merged> merge .a
.merged> merge .b
.merged> merge.old .a
.merged> merge.old .b
```
Updating conflicted definitions works fine, and the associated patch contains two entries.

View File

@ -28,7 +28,7 @@ Cause a conflict:
a.x : Nat
b.x : Nat
.merged> merge .a
.merged> merge.old .a
Here's what's changed in the current namespace after the
merge:
@ -44,7 +44,7 @@ Cause a conflict:
Applying changes from patch...
.merged> merge .b
.merged> merge.old .b
Here's what's changed in the current namespace after the
merge: