Patchwork [1,of,2,STABLE] test: add tests for branches and tags with static http repo (issue5613)

login
register
mail settings
Submitter Gregory Szorc
Date July 29, 2017, 8:05 p.m.
Message ID <e0500c5adb19b6020327.1501358752@ubuntu-vm-main>
Download mbox | patch
Permalink /patch/22579/
State Accepted
Headers show

Comments

Gregory Szorc - July 29, 2017, 8:05 p.m.
# HG changeset patch
# User Gregory Szorc <gregory.szorc@gmail.com>
# Date 1501357205 25200
#      Sat Jul 29 12:40:05 2017 -0700
# Branch stable
# Node ID e0500c5adb19b60203274bc2f63e500b9b73bf2d
# Parent  850d2ec2cf6a266987a401752c909f95dd8c4c53
test: add tests for branches and tags with static http repo (issue5613)

Mercurial currently fails to clone by revision on static http
repos with tags. The added tests demonstrate this.
Yuya Nishihara - July 30, 2017, 4:46 a.m.
On Sat, 29 Jul 2017 13:05:52 -0700, Gregory Szorc wrote:
> # HG changeset patch
> # User Gregory Szorc <gregory.szorc@gmail.com>
> # Date 1501357205 25200
> #      Sat Jul 29 12:40:05 2017 -0700
> # Branch stable
> # Node ID e0500c5adb19b60203274bc2f63e500b9b73bf2d
> # Parent  850d2ec2cf6a266987a401752c909f95dd8c4c53
> test: add tests for branches and tags with static http repo (issue5613)

Looks good. Queued, thanks.

Patch

diff --git a/tests/test-static-http.t b/tests/test-static-http.t
--- a/tests/test-static-http.t
+++ b/tests/test-static-http.t
@@ -156,4 +156,43 @@  test with non-repo
   $ hg clone static-http://localhost:$HGPORT/notarepo local3
   abort: 'http://localhost:$HGPORT/notarepo' does not appear to be an hg repository!
   [255]
+
+Clone with tags and branches works
+
+  $ hg init remote-with-names
+  $ cd remote-with-names
+  $ echo 0 > foo
+  $ hg -q commit -A -m initial
+  $ echo 1 > foo
+  $ hg commit -m 'commit 1'
+  $ hg -q up 0
+  $ hg branch mybranch
+  marked working directory as branch mybranch
+  (branches are permanent and global, did you want a bookmark?)
+  $ echo 2 > foo
+  $ hg commit -m 'commit 2 (mybranch)'
+  $ hg tag -r 1 'default-tag'
+  $ hg tag -r 2 'branch-tag'
+
+  $ cd ..
+
+  $ hg clone static-http://localhost:$HGPORT/remote-with-names local-with-names
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 5 changesets with 5 changes to 2 files (+1 heads)
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+Clone a specific branch works
+
+  $ hg clone -r mybranch static-http://localhost:$HGPORT/remote-with-names local-with-names-branch 2> /dev/null
+  [1]
+
+Clone a specific tag works
+
+  $ hg clone -r default-tag static-http://localhost:$HGPORT/remote-with-names local-with-names-tag 2> /dev/null
+  [1]
+
   $ killdaemons.py