patx/hglab
Add existing Mercurial repo push instructions and ensure repos with commits and no README do not show onboarding instructions
Commit 701cc5160864 · Harrison Erd · 2026-05-03 21:16 -0400
Comments
No comments yet.
Diff
diff --git a/templates/repo.tpl b/templates/repo.tpl
--- a/templates/repo.tpl
+++ b/templates/repo.tpl
@@ -30,13 +30,26 @@
<pre class="readme">{{readme}}</pre>
% else:
<div class="empty">
- <p>This repository is empty or has no README.</p>
- <pre>hg clone {{clone_url}}
+ % if commit_count == 0:
+ <p>This repository is empty.</p>
+ <h3>Start with a fresh checkout</h3>
+ <pre>hg clone {{clone_url}}
cd {{repo["name"]}}
echo "# {{repo["name"]}}" > README.md
hg add README.md
hg commit -m "Initial commit"
hg push</pre>
+ <h3>Push an existing local Mercurial repo</h3>
+ <pre>cd /path/to/existing-repo
+hg push {{clone_url}}</pre>
+ <p class="muted">Push will ask for the repository owner's or a contributor's username and password.</p>
+ % else:
+ <p>This repository has no README.</p>
+ <pre>echo "# {{repo["name"]}}" > README.md
+hg add README.md
+hg commit -m "Add README"
+hg push</pre>
+ % end
</div>
% end
</section>