# Issue with empty repositories

**URL:** https://www.finalbuilder.com/forums/t/issue-with-empty-repositories/5279
**Category:** Discussion
**Created:** [December 3, 2014, 10:23am UTC](https://www.finalbuilder.com/forums/t/issue-with-empty-repositories/5279 "2014-12-03T10:23:36Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![jeremys](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/jeremys/32/130_2.png) [@jeremys](https://www.finalbuilder.com/forums/u/jeremys)
#### Post date: [December 3, 2014, 10:23am UTC](https://www.finalbuilder.com/forums/t/issue-with-empty-repositories/5279/1 "2014-12-03T10:23:36Z")

</div>

We use SurroundSCM for our version control and for all kinds of antiquated reasons, we often use repositories to create our folder structure. &nbsp;We go so far as to create some empty repositories just for build steps that will populate those eventually.  
  
This causes a problem with the cached repos as I believe Mercurial doesn’t track repos, but files. &nbsp;I’m sure at this point the only solution is to create files in those folders, but are you aware of any other way to get around this?

---

<div class="post-metadata">

### Author: ![Sparky](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/sparky/32/10_2.png) [@Sparky](https://www.finalbuilder.com/forums/u/Sparky)
#### Post date: [December 4, 2014, 1:15am UTC](https://www.finalbuilder.com/forums/t/issue-with-empty-repositories/5279/2 "2014-12-04T01:15:10Z")

</div>

Hi Jeremy,  
  
Which version of Continua are you running? The latest version handles empty changesets by adding a marker file to the repository cache which is excluded when exporting the files.

---

<div class="post-metadata">

### Author: ![jeremys](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/jeremys/32/130_2.png) [@jeremys](https://www.finalbuilder.com/forums/u/jeremys)
#### Post date: [December 4, 2014, 1:37am UTC](https://www.finalbuilder.com/forums/t/issue-with-empty-repositories/5279/3 "2014-12-04T01:37:18Z")

</div>

I just upgraded today to 1.5.1.23 (we were running 1.0.something really old). It’s not the change of a repo with no files, but existing empty repos that are the cause of build problems. Our post build steps expect folders to exist and then they don’t and build failures.   
  
 I can look at the source on disk in the continua cache and see there are missing folders. ![]()

---

<div class="post-metadata">

### Author: ![jeremys](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/jeremys/32/130_2.png) [@jeremys](https://www.finalbuilder.com/forums/u/jeremys)
#### Post date: [December 4, 2014, 1:40am UTC](https://www.finalbuilder.com/forums/t/issue-with-empty-repositories/5279/4 "2014-12-04T01:40:53Z")

</div>

Well, I guess I can’t edit my previous post, looks like I got the image path wrong: [http://www.codemonkeycodes.com/images/capture.png](http://www.codemonkeycodes.com/images/capture.png)

---

<div class="post-metadata">

### Author: ![Sparky](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/sparky/32/10_2.png) [@Sparky](https://www.finalbuilder.com/forums/u/Sparky)
#### Post date: [December 4, 2014, 1:46am UTC](https://www.finalbuilder.com/forums/t/issue-with-empty-repositories/5279/5 "2014-12-04T01:46:18Z")

</div>

Hi Jeremy,  
  
You can fix the old repository caches by resetting the repositories on the administration page at&nbsp;[http://hostname/administration/ci/repositories](http://hostname/administration/ci/repositories)

---

<div class="post-metadata">

### Author: ![Sparky](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/sparky/32/10_2.png) [@Sparky](https://www.finalbuilder.com/forums/u/Sparky)
#### Post date: [December 4, 2014, 1:59am UTC](https://www.finalbuilder.com/forums/t/issue-with-empty-repositories/5279/6 "2014-12-04T01:59:55Z")

</div>

I just looked at the image you’ve posted and it seems I misunderstood the issue. It’s not that the root repository is empty - it’s that folders within the repository are empty. The confusion here is due to Surround SCM calling every folder a repository.&nbsp;  
  
Currently we only add an empty changeset marker to the root of a new empty repository. We’ll look into whether we can add these a marker files to empty folders before checking them into our repository cache.&nbsp;

---

<div class="post-metadata">

### Author: ![Sparky](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/sparky/32/10_2.png) [@Sparky](https://www.finalbuilder.com/forums/u/Sparky)
#### Post date: [December 4, 2014, 6:13am UTC](https://www.finalbuilder.com/forums/t/issue-with-empty-repositories/5279/7 "2014-12-04T06:13:16Z")

</div>

We’ve investigated further and the problem here is not only that Mercurial does not track folders. There is also a problem with the Surround command line options that we use. “sscm cruisecontrol -r” does not list changes to folders and “sscm get -r” does not get folders. There may be a way around this be querying each subrepository individually but this would not be a small piece of work.  
  
For now we recommend that you add a your own marker file e.g. .keepThisFolder &nbsp;to each empty repository.  
&nbsp;

---

<div class="post-metadata">

### Author: ![jeremys](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/jeremys/32/130_2.png) [@jeremys](https://www.finalbuilder.com/forums/u/jeremys)
#### Post date: [December 4, 2014, 6:33am UTC](https://www.finalbuilder.com/forums/t/issue-with-empty-repositories/5279/8 "2014-12-04T06:33:40Z")

</div>

Thanks for looking into this. For now I’ve addressed it by having a stage that creates all the necessary folders, but long term I think a “empty\_folder.txt” or something like that is the “correct” solution.   
  
 As I recall, doesn’t Mercurial treat “dot files” (.keepthis) as special files, or have you guys already come up with ways to get around this?

---

<div class="post-metadata">

### Author: ![Sparky](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/sparky/32/10_2.png) [@Sparky](https://www.finalbuilder.com/forums/u/Sparky)
#### Post date: [December 5, 2014, 4:58am UTC](https://www.finalbuilder.com/forums/t/issue-with-empty-repositories/5279/9 "2014-12-05T04:58:30Z")

</div>

Hi Jeremy,  
  
Mercurial treats .hg\* files as special files. We can however tell it to ignore other file patterns.
