# Limit Repository Rules

**URL:** https://www.finalbuilder.com/forums/t/limit-repository-rules/6529
**Category:** Bugs
**Tags:** fixed
**Created:** [July 23, 2019, 9:25pm UTC](https://www.finalbuilder.com/forums/t/limit-repository-rules/6529 "2019-07-23T21:25:00Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![dipold](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/dipold/32/1834_2.png) [@dipold](https://www.finalbuilder.com/forums/u/dipold)
#### Post date: [July 23, 2019, 9:25pm UTC](https://www.finalbuilder.com/forums/t/limit-repository-rules/6529/1 "2019-07-23T21:25:01Z")

</div>

I have a repository with the follow structure of one component:

\comp\IBObjects  
\comp\IBObjects\addon  
\comp\IBObjects\apps  
\comp\IBObjects\build  
\comp\IBObjects\docs  
\comp\IBObjects\lib  
\comp\IBObjects\packages  
\comp\IBObjects\samples  
\comp\IBObjects\source  
\comp\IBObjects\tutorials\

As the build process only needs the “lib” folder, I created the following rules in “Edit State \> Repository Rules” in order to copy only lib folder:

$Source$ \>\> Source  
-$Source.Ultra$\comp\IBObjects\* \> Source  
-$Source.Ultra$\comp\IBObjects\addon\*\* \> Source  
-$Source.Ultra$\comp\IBObjects\apps\*\* \> Source  
-$Source.Ultra$\comp\IBObjects\build\*\* \> Source  
-$Source.Ultra$\comp\IBObjects\docs\*\* \> Source  
-$Source.Ultra$\comp\IBObjects\packages\*\* \> Source  
-$Source.Ultra$\comp\IBObjects\samples\*\* \> Source  
-$Source.Ultra$\comp\IBObjects\source\*\* \> Source  
-$Source.Ultra$\comp\IBObjects\tutorials\*\* \> Source

Everything works fine, however, as I added more rules like this, I got an exception because there are too many rules:

An error occurred while syncing files from the server to the agent. Details: Exception: ProcessException  
Message: Running C:\Program Files\VSoft Technologies\ContinuaCI Agent\hg\hg.exe with arguments … failed with return code 255 and error output: "\*\* Unknown exception encountered with possibly-broken third-party extension win32lfn  
\*\* which supports versions unknown of Mercurial.  
\*\* Please disable win32lfn and try your action again.  
\*\* If that fixes the bug please report it to the extension author.  
\*\* Python 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 20:53:40) [MSC v.1500 64 bit (AMD64)]  
\*\* Mercurial Distributed SCM (version 4.9.1)  
\*\* Extensions loaded: win32lfn  
Traceback (most recent call last):  
File “hg”, line 43, in   
…  
File “sre\_compile.pyc”, line 583, in compile  
**AssertionError: sorry, but this version only supports 100 named groups**  
"  
Stack Trace: at Continua.Shared.Utils.Mercurial.Run(ProcessArguments args, String workingFolder, Func`2 checkResult, Boolean runRecoverIfRequired, Boolean allowTermination, Nullable`1 timeoutInSecs) at Continua.Shared.Utils.Mercurial.Archive(String repository, String destination, String revision, IEnumerable`1 includes, IEnumerable`1 excludes, Boolean listFiles) at Continua.Modules.Builds.Agent.FileSync.AgentRepositoryCache.\<\>c\_\_DisplayClass20\_0.b\_\_0() at Continua.Shared.Utils.ReadWriteLockList`1.WithReadLock(TId id, CancellationTokenSource cancelTokenSource, Action action) at Continua.Modules.Builds.Agent.FileSync.AgentRepositoryCache.Export(String dest, String revision, String include, IEnumerable`1 excludes, Boolean listFiles) at Continua.Modules.Builds.Agent.AgentRepositoryHelper.CopySourceToWorkspace(String filePattern, IEnumerable`1 excludes, String relativeDestination, AgentWorkspaceSyncContext wsCtx, Boolean logRepoFiles, TransportContextDTO transportContext) at Continua.Modules.Builds.Agent.AgentBuildHelper.SyncSourceFromServer(IEnumerable`1 rules, AgentWorkspaceSyncContext workspaceCtx) at Continua.Modules.Builds.Agent.AgentBuildHelper.InitialiseWorkspaceOnAgent(IAgentCallbackProxy proxy, TransportContextDTO source, Guid callId)

Is there a way around this limitation?

---

<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: [July 24, 2019, 12:20am UTC](https://www.finalbuilder.com/forums/t/limit-repository-rules/6529/2 "2019-07-24T00:20:14Z")

</div>

Hi Rafael,

Thank you for reporting this issue. We have reproduced the error and it is due to a [limitation in the Python code base](https://github.com/python/cpython/blob/2.7/Lib/sre_compile.py#L580-L584).

We have worked out a way to change our code to avoid this limitation and will upload a new version once this is tested. Meanwhile, we would recommend replacing all your rules with a single include rule. e.g.

```auto
$Source.Ultra$\comp\IBObjects\lib\** > Source

```

This should achieve the same result.

---

<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: [July 24, 2019, 6:24am UTC](https://www.finalbuilder.com/forums/t/limit-repository-rules/6529/3 "2019-07-24T06:24:50Z")

</div>

Hi Rafael,

We have uploaded a hotfix for this issue which you can download using the following links:

- [Download Continua CI v1.9.1.290 (64 bit)](http://downloads.finalbuilder.com/downloads/continua/1.9.1/ContinuaCI.Server.Setup_x64_1.9.1.290.HotFix.exe)
- [Download Agent Installer v1.9.1.290 (64 bit)](http://downloads.finalbuilder.com/downloads/continua/1.9.1/ContinuaCI.Agent.Setup_x64_1.9.1.290.HotFix.exe)
- [Download Agent Installer v1.9.1.290 (32 bit)](http://downloads.finalbuilder.com/downloads/continua/1.9.1/ContinuaCI.Agent.Setup_1.9.1.290.HotFix.exe)

---

<div class="post-metadata">

### Author: ![dipold](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/dipold/32/1834_2.png) [@dipold](https://www.finalbuilder.com/forums/u/dipold)
#### Post date: [July 24, 2019, 12:09pm UTC](https://www.finalbuilder.com/forums/t/limit-repository-rules/6529/4 "2019-07-24T12:09:09Z")

</div>

Thank you for the quick response and fix, Dave!

\*The single rule isn’t possible to me, as I tried to simplify as much as possible on problem in my example.
