title: How to begin repairing repository
body: <p>We just recreated all of our repos a week ago and today we're already near that point.  I need to figure out why this keeps happening...</p>
  
  <pre><code>$hg verify
  checking changesets
  checking manifests
  crosschecking files in changesets and manifests
  checking files
   smartdox/application/helpers/common_helper.php@?: rev 1 points to unexpected changeset 10
   (expected )
   smartdox/application/helpers/common_helper.php@?: fbe7ec6785e5 not in manifests
   smartdox/application/libraries/MY_Model.php@?: rev 1 points to unexpected changeset 10
   (expected )
   smartdox/application/libraries/MY_Model.php@?: d84e95aff93f not in manifests
   smartdox/application/product_customizers/Proposals - CA Integrated/product.php@?: rev 1 points to unexpected changeset 2
   (expected 7)
   smartdox/application/product_customizers/Proposals - CA Specialty/custom.js@?: rev 1 points to unexpected changeset 2
   (expected 7)
   smartdox/application/product_customizers/Proposals - CA Specialty/product.php@?: rev 1 points to unexpected changeset 2
   (expected 7)
   smartdox/application/product_customizers/Proposals - GA Integrated/product.php@?: rev 1 points to unexpected changeset 2
   (expected 7)
   smartdox/application/product_customizers/Proposals - NY Combined/custom.js@?: rev 1 points to unexpected changeset 5
   (expected 10)
   smartdox/application/product_customizers/Proposals - NY Combined/custom.js@?: rev 2 points to unexpected changeset 6
   (expected 12)
   smartdox/application/product_customizers/Proposals - NY Combined/product.php@?: rev 1 points to unexpected changeset 2
   (expected 7)
   smartdox/application/views/help/training.php@?: rev 1 points to unexpected changeset 7
   (expected 6)
   smartdox/css/admin.css@?: rev 1 points to nonexistent changeset 26
   (expected )
   smartdox/css/admin.css@?: 5c92b2914085 not in manifests
  </code></pre>
  
  <p>I know we need to recreate the repo, but I need to determine the actual source of the problem so I know why this keeps happening.  Anyone have any thoughts on how I can investigate/fix these issues?  <a href="https://www.mercurial-scm.org/wiki/RepositoryCorruption" rel="nofollow noreferrer">https://www.mercurial-scm.org/wiki/RepositoryCorruption</a> isn't as helpful as I would've hoped... it doesn't outline what's going on with <code>rev x points to unexpected changeset x</code></p>
  
  <p>It seems like Mercurial should be transactional and thus should never allow us to corrupt our repositories unless we go in and manually delete files.</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>We believe that samba is the problem.  We use it to map linux drives on windows so we can use Tortoise HG.  We're in the process of coming up with alternative solutions.</p>