mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-10 15:35:49 +01:00
61 lines
1.4 KiB
JavaScript
61 lines
1.4 KiB
JavaScript
//@flow
|
|
import React from "react";
|
|
import type { Repository } from "@scm-manager/ui-types";
|
|
|
|
type Props = {
|
|
repository: Repository
|
|
}
|
|
|
|
class ProtocolInformation extends React.Component<Props> {
|
|
|
|
render() {
|
|
const { repository } = this.props;
|
|
if (!repository._links.httpProtocol) {
|
|
return null;
|
|
}
|
|
return (
|
|
<div>
|
|
<h4>Clone the repository</h4>
|
|
<pre>
|
|
<code>hg clone {repository._links.httpProtocol.href}</code>
|
|
</pre>
|
|
<h4>Create a new repository</h4>
|
|
<pre>
|
|
<code>
|
|
hg init {repository.name}
|
|
<br />
|
|
echo "[paths]" > .hg/hgrc
|
|
<br />
|
|
echo "default = {repository._links.httpProtocol.href}" > .hg/hgrc
|
|
<br />
|
|
echo "# {repository.name}" > README.md
|
|
<br />
|
|
hg add README.md
|
|
<br />
|
|
hg commit -m "added readme"
|
|
<br />
|
|
<br />
|
|
hg push
|
|
<br />
|
|
</code>
|
|
</pre>
|
|
<h4>Push an existing repository</h4>
|
|
<pre>
|
|
<code>
|
|
# add the repository url as default to your .hg/hgrc e.g:
|
|
<br />
|
|
default = {repository._links.httpProtocol.href}
|
|
<br />
|
|
# push to remote repository
|
|
<br />
|
|
hg push
|
|
</code>
|
|
</pre>
|
|
</div>
|
|
);
|
|
}
|
|
|
|
}
|
|
|
|
export default ProtocolInformation;
|