( )⚙ D4549 localrepo: move check for existing repo into createrepository()

This is an archive of the discontinued Mercurial Phabricator instance.

localrepo: move check for existing repo into createrepository()
ClosedPublic

Authored by martinvonz on Sep 12 2018, 3:23 PM.

Details

Summary

For symmetry with the check for existence of a repo in
localrepository.init, we should check for the non-existence in
createrepository(). We could alternatively move both checks into
instance().

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.Sep 12 2018, 3:23 PM
pulkit added a subscriber: pulkit.Sep 12 2018, 4:22 PM

test-init.t and test-mq.t says hi!

--- /storage/pulkit/repo/hgpush/tests/test-init.t
+++ /storage/pulkit/repo/hgpush/tests/test-init.t.err
@@ -99,7 +99,7 @@
 test failure
 
   $ hg init local
-  abort: repository local already exists!
+  abort: File exists: '$TESTTMP/local/.hg'
   [255]
 
 init+push to remote2
@@ -144,14 +144,14 @@
 init to existing repo
 
   $ hg init -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote1
-  abort: repository remote1 already exists!
+  abort: File exists: '$TESTTMP/remote1/.hg'
   abort: could not create remote repo!
   [255]
 
 clone to existing repo
 
   $ hg clone -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" local ssh://user@dummy/remote1
-  abort: repository remote1 already exists!
+  abort: File exists: '$TESTTMP/remote1/.hg'
   abort: could not create remote repo!
   [255]
 

ERROR: test-init.t output changed
!
--- /storage/pulkit/repo/hgpush/tests/test-mq.t
+++ /storage/pulkit/repo/hgpush/tests/test-mq.t.err
@@ -154,7 +154,7 @@
   guards
   $ cat .hg/patches/series
   $ hg qinit -c
-  abort: repository $TESTTMP/d/.hg/patches already exists!
+  abort: File exists: '$TESTTMP/d/.hg/patches/.hg'
   [255]
   $ cd ..
 

ERROR: test-mq.t output changed
In D4549#69559, @pulkit wrote:

test-init.t and test-mq.t says hi!

Sorry! :( Looks like I forgot to drop the .hg argument when I switched from wdirvfs to hgvfs. I'll fix right away.

martinvonz updated this revision to Diff 10977.Sep 12 2018, 5:50 PM
This revision was automatically updated to reflect the committed changes.