#12128: "hg verify" is not a proper way to check whether there is an hg repo
--------------------------------+-------------------------------------------
   Reporter:  jdemeyer          |          Owner:  GeorgSWeber    
       Type:  defect            |         Status:  positive_review
   Priority:  blocker           |      Milestone:  sage-4.8       
  Component:  build             |       Keywords:                 
Work_issues:                    |       Upstream:  N/A            
   Reviewer:  Michael Orlitzky  |         Author:  Jeroen Demeyer 
     Merged:                    |   Dependencies:                 
--------------------------------+-------------------------------------------
Changes (by mjo):

 * cc: mjo (added)
  * reviewer:  => Michael Orlitzky
  * status:  needs_review => positive_review


Comment:

 At first I though this was trading one edge case for another (albeit less
 likely) one. It seems, however, that testing for a `.hg` directory is as
 good as it gets.

 First of all, the issue is valid:

 {{{
 $ cd ~/tmp
 tmp $ hg init
 tmp $ mkdir subdir
 tmp $ cd subdir
 subdir $ hg verify
 checking changesets
 checking manifests
 crosschecking files in changesets and manifests
 checking files
 0 files, 0 changesets, 0 total revisions
 }}}

 Within `subdir`, I thought there would be an issue: we can have an `.hg`
 subdirectory that isn't Mercurial data. However, it looks like Mercurial
 itself ignores that fact:

 {{{
 subdir $ ls -a
 total 8.0K
 drwxr-xr-x 2 mjo mjo 4.0K 2011-12-09 15:38 .
 drwxr-xr-x 4 mjo mjo 4.0K 2011-12-09 15:38 ..
 subdir $ hg root
 /home/mjo/tmp
 subdir $ mkdir .hg
 subdir $ hg root
 /home/mjo/tmp/subdir
 }}}

 Moreover, `hg verify` and the like work with just an empty `.hg`
 directory. So, we don't gain anything by doing both tests.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12128#comment:2>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to