This is an archive of the discontinued Mercurial Phabricator instance.

tests: set old git default branch name for compatibility
ClosedPublic

Authored by martinvonz on Nov 30 2020, 1:05 PM.

Details

Summary

Git's default branch name has changed on my machine (from "master" to
"main"). Let's set the old name in our tests so we're compatible with
both defaults (and maybe still compatible with Git versions that don't
know about the config option).

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

martinvonz created this revision.Nov 30 2020, 1:05 PM

It still fails like this for me:

--- /usr/local/google/home/martinvonz/hg/tests/test-git-interop.t
+++ /usr/local/google/home/martinvonz/hg/tests/test-git-interop.t.err
@@ -213,7 +213,8 @@


   $ hg log -r "children(3d9be8deba43)" -T"{node|short} {children}\n"
-  a1983dd7fb19 3:d8ee22687733
+  abort: unknown revision '3d9be8deba43'
+  [255]

 hg annotate

@@ -267,14 +268,13 @@

 This coveres changelog.findmissing()
   $ hg merge --preview 3d9be8deba43
+  abort: unknown revision '3d9be8deba43'
+  [255]

 This covers manifest.diff()
   $ hg diff -c 3d9be8deba43
-  diff -r c5864c9d16fb -r 3d9be8deba43 beta
-  --- /dev/null        Thu Jan 01 00:00:00 1970 +0000
-  +++ b/beta   Mon Jan 01 00:00:11 2007 +0000
-  @@ -0,0 +1,1 @@
-  +beta
+  abort: unknown revision '3d9be8deba43'
+  [255]

It still fails like this for me:

--- /usr/local/google/home/martinvonz/hg/tests/test-git-interop.t
+++ /usr/local/google/home/martinvonz/hg/tests/test-git-interop.t.err
@@ -213,7 +213,8 @@
   $ hg log -r "children(3d9be8deba43)" -T"{node|short} {children}\n"
-  a1983dd7fb19 3:d8ee22687733
+  abort: unknown revision '3d9be8deba43'
+  [255]
 hg annotate
@@ -267,14 +268,13 @@
 This coveres changelog.findmissing()
   $ hg merge --preview 3d9be8deba43
+  abort: unknown revision '3d9be8deba43'
+  [255]
 This covers manifest.diff()
   $ hg diff -c 3d9be8deba43
-  diff -r c5864c9d16fb -r 3d9be8deba43 beta
-  --- /dev/null        Thu Jan 01 00:00:00 1970 +0000
-  +++ b/beta   Mon Jan 01 00:00:11 2007 +0000
-  @@ -0,0 +1,1 @@
-  +beta
+  abort: unknown revision '3d9be8deba43'
+  [255]

I get that too, plus this with 2.17.1 (which is maybe too old, but it's what comes with Ubuntu 18.04):

--- /mnt/c/Users/Matt/hg/tests/test-git-interop.t
+++ /mnt/c/Users/Matt/hg/tests/test-git-interop.t.err
@@ -65,6 +65,7 @@
   On branch master
   Untracked files:
     (use "git add <file>..." to include in what will be committed)
+
        gamma

   nothing added to commit but untracked files present (use "git add" to track)
@@ -132,6 +133,7 @@
   On branch master
   Untracked files:
     (use "git add <file>..." to include in what will be committed)
+
        gamma

   nothing added to commit but untracked files present (use "git add" to track)
@@ -151,7 +153,8 @@
   $ git status
   On branch master
   Changes to be committed:
-    (use "git restore --staged <file>..." to unstage)
+    (use "git reset HEAD <file>..." to unstage)
+
        new file:   gamma


@@ -163,6 +166,7 @@
   On branch master
   Untracked files:
     (use "git add <file>..." to include in what will be committed)
+
        gamma

   nothing added to commit but untracked files present (use "git add" to track)
mharbison72 accepted this revision.Dec 1 2020, 11:10 PM
This revision is now accepted and ready to land.Dec 1 2020, 11:10 PM