[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Commits files to subversion from 2 different directories

From: ying lcs <yinglcs_at_gmail.com>
Date: 2007-01-15 18:11:59 CET

Thanks for your detailed response.

Here is one of the example of the svn summary output:

 M file:///srv/svn/repositories/test/tags/VERSION0/server/tests/src/JNI/java/Test1.java
(M is second column)

$ cd ~/org-source
$ ls -la Test1.java
-rwxrwxr-x 1 yinglcs yinglcs 17780 Dec 7 15:11 Test1.java*

$ cd ~/mod-source
$ ls -la Test1.java
-rwxrwxr-x 1 yinglcs yinglcs 17780 Apr 18 2004 Test1.java*
They have the same size and permission.

The difference is empty:
$ diff Test1.java ~/mod-source/server/tests/src/JNI/java/Test1.java
$

On 1/15/07, Ryan Schmidt <subversion-2007a@ryandesign.com> wrote:
> On Jan 15, 2007, at 01:09, ying lcs wrote:
>
> > On 1/14/07, Ryan Schmidt wrote:
> >
> >> On Jan 14, 2007, at 10:27, ying lcs wrote:
> >>
> >> > i have 2 directories of source code:
> >> > 1. org-source
> >> > 2. modified-source (org-source + modified source code, don't
> >> exactly
> >> > remember which files have changed).
> >> >
> >> > and i want to use subversion to do version control. Here is what I
> >> > did:
> >> > 1. create a new repository 'source' in subversion
> >> > 2. cd to org-source and
> >> > svn import . file:///srv/svn/repositories/source --message
> >> > "Initial import"
> >> >
> >> > Then, I want to
> >> > 3: tag all the files in the source with a label called 'VERSION1"
> >>
> >> Subversion does not do branching and tagging the way CVS does. You do
> >> not "tag files with a label". Instead, you simply make a copy of your
> >> files elsewhere, usually to a directory named "tags". The book
> >> explains this more.
> >>
> >> http://svnbook.red-bean.com/en/1.2/svn.branchmerge.tags.html
> >>
> >> There's even an appendix for users coming to Subversion from CVS.
> >>
> >> http://svnbook.red-bean.com/en/1.2/svn.forcvs.html
> >>
> >> > 4: commit all files in the directory 'modified-source' to
> >> subversion
> >> > so that subversion can figure out what files are different. And it
> >> > will create a new version if the files is different and add the
> >> files
> >> > to the repository if it is a new file.
> >>
> >> You may want to use the svn_load_dirs.pl script which is included in
> >> the Subversion source and is designed for this kind of scenario. It's
> >> described in the vendor branching section of the book:
> >>
> >> http://svnbook.red-bean.com/en/1.2/svn.advanced.vendorbr.html
> >>
> >> In particular here:
> >>
> >> http://svnbook.red-bean.com/en/1.2/
> >> svn.advanced.vendorbr.html#svn.advanced.vendorbr.svn_load_dirs
> >>
> >> > 5. tag all the files in trunk with a label called VERSION2"
> >>
> >> svn_load_dirs.pl can automatically create a tag of your newly-
> >> imported version.
> >>
> >> > Can you please tell me if step 3 and 4 are possible?
> >>
> >> So putting this all together:
> >>
> >> > 1. create a new repository 'source' in subversion
> >>
> >> svnadmin create /srv/svn/repositories/source
> >>
> >> > 2. cd to org-source and
> >> > svn import . file:///srv/svn/repositories/source --message
> >> > "Initial import"
> >>
> >> For each new project, you should generally set up the recommended
> >> "trunk" / "branches" / "tags" directory structure. The reasons are
> >> explained in the book:
> >>
> >> http://svnbook.red-bean.com/en/1.2/svn.branchmerge.using.html
> >>
> >> So create these empty directories:
> >>
> >> svn mkdir file:///srv/svn/repositories/source/trunk \
> >> -m "Making trunk dir"
> >> svn mkdir file:///srv/svn/repositories/source/branches \
> >> -m "Making branches dir"
> >> svn mkdir file:///srv/svn/repositories/source/tags \
> >> -m "Making tags dir"
> >>
> >> Then you can import the original source into the trunk.
> >>
> >> svn import /path/to/org-source \
> >> file:///srv/svn/repositories/source/trunk \
> >> -m "Initial import"
> >>
> >> > 3: tag all the files in the source with a label called 'VERSION1"
> >>
> >> Create the "VERSION1" tag by copying the trunk to a new name in the
> >> tags directory:
> >>
> >> svn cp file:///srv/svn/repositories/source/trunk \
> >> file:///srv/svn/repositories/source/tags/VERSION1 \
> >> -m "Creating VERSION1 tag"
> >>
> >> > 4: commit all files in the directory 'modified-source' to
> >> subversion
> >> > so that subversion can figure out what files are different. And it
> >> > will create a new version if the files is different and add the
> >> files
> >> > to the repository if it is a new file.
> >> >
> >> > 5. tag all the files in trunk with a label called VERSION2"
> >>
> >> Use svn_load_dirs.pl to load modified-source and tag it as VERSION2:
> >>
> >> svn_load_dirs.pl \
> >> -t tags/VERSION2 \
> >> file:///srv/svn/repositories/source \
> >> trunk \
> >> /path/to/modified-source
> >
> > i did your suggestion. It works. And at the end i did a 'svn
> > --summarize diff' to show the difference between 2 versions.
> >
> > however, I notice there are entries which show files whose content are
> > identical. Can you please tell me why is that (content is the same but
> > timestamps are different)? If that is the case, is it possible to
> > filter those result out? i.e. just show files which are content
> > different?
>
> Um... Subversion doesn't even store files' timestamps in the
> repository, so the only reason for the files to be showing up in the
> list is if their content ("M" in the first column) or their
> properties ("M" in the second column) are in fact different.
>
> If the M appears in the second column: Perhaps you changed the
> properties on a file? If so you can filter these out of the list by
> finding those lines where the first column is empty and the second
> column is an M and removing those lines from the output, for example
> by piping the output of "svn diff --summarize" through grep, sed or awk.
>
> Or perhaps the file content does in fact differ, but only in white
> space or line ending? Perhaps you have auto-props set up with svn:eol-
> style, and perhaps they were not set on the initial import, but were
> on the second load, or vice versa? If so, I'm not sure how best to
> exclude these items from the output. You may have to save the list of
> files and do a manual comparison of the files using your own
> criteria. For example, you could examine each file using your OS's
> diff program's -b option which ignores whitespace.
>
>
> --
>
> To reply to the mailing list, please use your mailer's Reply To All
> function
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Mon Jan 15 18:21:24 2007

This is an archived mail posted to the Subversion Users mailing list.