Patchwork [6,of,6,py3,v2] py3: prove `hg {add,addremove,commit} all work

login
register
mail settings
Submitter Augie Fackler
Date March 23, 2017, 3:11 p.m.
Message ID <980459b9d372315478b5.1490281899@arthedain.pit.corp.google.com>
Download mbox | patch
Permalink /patch/19610/
State Accepted
Headers show

Comments

Augie Fackler - March 23, 2017, 3:11 p.m.
# HG changeset patch
# User Augie Fackler <augie@google.com>
# Date 1489902476 14400
#      Sun Mar 19 01:47:56 2017 -0400
# Node ID 980459b9d372315478b5657c3a4271b903736f6f
# Parent  2190115dab97a551cd5aac44a8a55e2df9fd6307
py3: prove `hg {add,addremove,commit} all work

We can't do a second commit in a repo yet, because pure-Python bdiff
is broken on Python 3. That is probably a good next step.

Patch

diff --git a/tests/test-check-py3-commands.t b/tests/test-check-py3-commands.t
--- a/tests/test-check-py3-commands.t
+++ b/tests/test-check-py3-commands.t
@@ -122,4 +122,44 @@  Test bytes-ness of policy.policy with HG
 
 `hg init` can create empty repos
 
-  $ $PYTHON3 `which hg` init emptyrepo
+  $ $PYTHON3 `which hg` init py3repo
+  $ cd py3repo
+  $ echo "This is the file 'iota'." > iota
+  $ $PYTHON3 $HGBIN status
+  ? iota
+  $ $PYTHON3 $HGBIN add iota
+  $ $PYTHON3 $HGBIN status
+  A iota
+  $ $PYTHON3 $HGBIN commit --message 'commit performed in Python 3'
+  $ $PYTHON3 $HGBIN status
+
+TODO: bdiff is broken on Python 3 so we can't do a second commit yet,
+when that works remove this rollback command.
+  $ hg rollback
+  repository tip rolled back to revision -1 (undo commit)
+  working directory now based on revision -1
+
+  $ mkdir A
+  $ echo "This is the file 'mu'." > A/mu
+  $ $PYTHON3 $HGBIN addremove
+  adding A/mu
+  $ $PYTHON3 $HGBIN status
+  A A/mu
+  A iota
+  $ HGEDITOR='echo message > ' $PYTHON3 $HGBIN commit
+  $ $PYTHON3 $HGBIN status
+
+Prove the repo is valid using the Python 2 `hg`:
+  $ hg verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  2 files, 1 changesets, 2 total revisions
+  $ hg log
+  changeset:   0:e825505ba339
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     message
+