You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Jonathan Wallace <jo...@gmail.com> on 2006/09/21 12:46:30 UTC

Best practices question

Hello,
 I have a question concerning best practices.  I have a set of files and
folders that make up a software program, let us call it program A, in
URL/trunk.  The main "executable" is a microsoft .mdb file which must be
treated as binary and should only be edited by one person at any time as
merges are impossible[0] on binary files.  There is also a program B that
shares a subset of the files in A including the main executable.  For the
subset of files and folders shared between A and B, I'd like to insure that
there is only one copy of those files in the repository.

My first thought was to make B a branch of A but then if someone
accidentally commits the main executable in a checked out copy of B, then I
now have two copies.  Obviously, one can merge this B executable back into
the main trunk but this doesn't solve the underlying problem.  I appreciate
any and all suggestions.

0. If anyone knows that my assumption about merging source code in mdb files
is incorrect, I'd love to know.

-- 
Jonathan Wallace

Re: Best practices question

Posted by Jacob Atzen <ja...@jacobatzen.dk>.
On Thu, Sep 21, 2006 at 01:37:54PM -0400, Jonathan Wallace wrote:
> No, I hadn't even though I've used them once in the past for incorporating
> 3rd party code into another project.  I'm still new to subversion and I
> appreciate you making that point.  After rereading the external section of
> the book, does svn 1.4 support external definitions for files now?  I didn't
> see anything about it in the release notes or changes file.  If so, that
> would seem to resolve my issue.

AFAIK externals works on directories not files.

> It might be easier to give better advice if you supply more details
> >about the directory layout of A and B.
> 
> 
> Here's an example:
> 
> directory_one/
> main.mdb
> version.txt
> reports/
> config/
> main.ico
> 
> directory_two/
> main.mdb
> version.txt
> reports/
> config/
> main.ico
> 
> All files in directory_one and directory_two are exactly the same.  Files
> within their subdirectories, reports/ and config/, are different.
> 
> Physically, directory_one and directory_two are equivalent applications with
> just different config files and different report files.  Logically, they are
> two separate applications.
> 
> My eventual goal is to move the bifurcation from the config/ and report/
> directories and into the application to simplify deployment of the whole
> application and maintenance of the reports.  The reports' formats are the
> same between directory_one/report and directory_two/report.  The only
> difference is that reports in directory_one connect to one data source and
> reports in directory_two connect to another one.

A couple of suggestions:

- Move the shared data into a subdirectory and import that as external
  from both projects. This is most likely the easier solution if you can
  get it to work. This will allow you to deploy the applications
  separately. Your directory structure would like like:

  /projects
    /shared
      foo.mdb
      ...
    /app1
      /reports
      /config
      /shared (external)
    /app2
      /reports
      ...


- Move the application specific data into a single directory, so you get
  something like:

  /project
    foo.mdb
    /app1
      /config
      /reports
    /app2
      /config
      /reports

  And then make the application recognize which application to use based
  on some configuration (file, database, whatever). This will not easily
  allow you to deploy the applications separately, but will fix the
  issue of duplication of the shared data.

I hope this helps.

-- 
Cheers,
- Jacob Atzen

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Best practices question

Posted by Jonathan Wallace <jo...@gmail.com>.
On 9/21/06, Jacob Atzen <ja...@jacobatzen.dk> wrote:
>
> On Thu, Sep 21, 2006 at 08:46:30AM -0400, Jonathan Wallace wrote:
> > There is also a program B that shares a subset of the files in A
> > including the main executable.  For the subset of files and folders
> > shared between A and B, I'd like to insure that there is only one copy
> > of those files in the repository.
> >
> > My first thought was to make B a branch of A but then if someone
> > accidentally commits the main executable in a checked out copy of B,
> then I
> > now have two copies.  Obviously, one can merge this B executable back
> into
> > the main trunk but this doesn't solve the underlying problem.  I
> appreciate
> > any and all suggestions.
>
> Have you considered externals for the shared parts?


No, I hadn't even though I've used them once in the past for incorporating
3rd party code into another project.  I'm still new to subversion and I
appreciate you making that point.  After rereading the external section of
the book, does svn 1.4 support external definitions for files now?  I didn't
see anything about it in the release notes or changes file.  If so, that
would seem to resolve my issue.

It might be easier to give better advice if you supply more details
> about the directory layout of A and B.


Here's an example:

directory_one/
main.mdb
version.txt
reports/
config/
main.ico

directory_two/
main.mdb
version.txt
reports/
config/
main.ico

All files in directory_one and directory_two are exactly the same.  Files
within their subdirectories, reports/ and config/, are different.

Physically, directory_one and directory_two are equivalent applications with
just different config files and different report files.  Logically, they are
two separate applications.

My eventual goal is to move the bifurcation from the config/ and report/
directories and into the application to simplify deployment of the whole
application and maintenance of the reports.  The reports' formats are the
same between directory_one/report and directory_two/report.  The only
difference is that reports in directory_one connect to one data source and
reports in directory_two connect to another one.

-- 
Jonathan Wallace

Re: Best practices question

Posted by Jacob Atzen <ja...@jacobatzen.dk>.
On Thu, Sep 21, 2006 at 08:46:30AM -0400, Jonathan Wallace wrote:
> Hello,
> I have a question concerning best practices.  I have a set of files and
> folders that make up a software program, let us call it program A, in
> URL/trunk.  The main "executable" is a microsoft .mdb file which must be
> treated as binary and should only be edited by one person at any time as
> merges are impossible[0] on binary files.

You can enforce this with the locking features of subversion. Even if
you don't people will not be able to commit stale versions of the binary
back to the repository.

> There is also a program B that shares a subset of the files in A
> including the main executable.  For the subset of files and folders
> shared between A and B, I'd like to insure that there is only one copy
> of those files in the repository.
> 
> My first thought was to make B a branch of A but then if someone
> accidentally commits the main executable in a checked out copy of B, then I
> now have two copies.  Obviously, one can merge this B executable back into
> the main trunk but this doesn't solve the underlying problem.  I appreciate
> any and all suggestions.

Have you considered externals for the shared parts?

It might be easier to give better advice if you supply more details
about the directory layout of A and B.

-- 
Cheers,
- Jacob Atzen

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org