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

Changeset
701cc5160864755a9f1953d11b84b79792d02993

View source at this commit

Comments

No comments yet.

Log in to comment

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"]}}" &gt; 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"]}}" &gt; README.md
+hg add README.md
+hg commit -m "Add README"
+hg push</pre>
+      % end
     </div>
   % end
 </section>