RE: History in subversion
From: Andrew Reedick <Andrew.Reedick_at_cbeyond.net>
Date: Wed, 12 Jun 2013 17:32:05 -0400
> From: Olivier Antoine [mailto:oliviera201304_at_gmail.com]
> But :
You cannot directly diff two revisions of a directory, where diff is defined as diff'ing the list of file/dir objects in the directory. Instead, SVN will diff the files under the directory tree. From a CC point of view, svn file objects are first class objects with version a version tree, history, etc., whereas SVN directory objects are not. (SVN dirs are second class-ish.)
This should help you to find files and what rev they're in. '^/' is the path or svn url to check. Foo.java is the file or regex you're looking for.
> When users ask for help, I have to go in their repository that I don't know at all, users often give less than half the information I need to locate the file where they need help.
If you're just trying to find a file in the current version of the repo, then "svn ls -R svn://..." You can use '-r' and peg revisions to search older revisions of the repo tree.
> About peg revision :
There's no such thing as a uuid or oid in SVN (or at least one that is user visible.) Instead, you can use "svn_url + revision number" or "svn_url + 'Last Changed Rev'" (which can be found via 'svn info') in order to uniquely identify a particular revision of something. 'Last Changed Rev' is preferable.
However, since SVN doesn't have true renames, 'svn copy' will normally create a new object with a new revision (aka last changed rev) number. A new revision number won't be created if you copy the parent dir the file is in. In CC parlance, instead of /repo/branches/1.0/foo.java and /repo/trunk/foo.java just being hard links to revision object #1452134521, in svn you wind up with either a new revision number:
So technically yes, SVN has the Evil Twin problem, however, it doesn't really cause problems with file merges per se, so Evil Twins aren't really a problem. Directory tree merges on the other hand, can be murder, but tree conflicts have been greatly improved in 1.7.
> Could you help more on diff dirs, please :
'svn diff', or checkout/export both branches (directories) and run your favorite diff tool on them. If you want to diff the contents of the dirs (i.e. the hard links,) then you can try 'svn ls -v' and diff the output (look at the rev numbers.) Generally speaking, in SVN, you don't diff directories, you diff the files in the baselines (aka branches.)
However, since SVN revisions are changesets (a collection of related changes,) you can also use 'svn mergeinfo' to "diff" two baselines/branches/directories (i.e. find what changes have not been applied from branchA to branchB.) Or you can just run the merge command to see what would get merged and then 'svn revert -R' to get back to a clean workspace (instead of checking in.) You can even do a a 'svn merge --ignore-ancestry' to merge unrelated trees (http://svnbook.red-bean.com/en/1.7/svn.branchmerge.advanced.html#svn.branchmerge.nomergedata)
Long story short, if you are managing changesets between branches, then svn is quite adequate. If you're diffing code trees, then something has gone wrong with your merges and/or change management process. =)
> I am very confused by many things with SVN, one of them is :
It's a feature to provide maximum flexibility. The kinds of people who merge random dirs together tend to be Darwin candidates, so it's a self-correcting activity. Just merge from the root of your branch dirs, and you'll be fine. IIRC, SVN's merge tracking can now handle sub-dir merges, but in my experience, you either merge the entire baseline/branch, or you merge (cherry-pick) individual revisions (which are changesets.) There's not much reason to merge two random directories.
The only real merging landmines are 'svn merge --reintegrate' and tree conflicts. The former you can read up on (and which is going away in 1.8), the latter is poorly documented and more annoying/tedious than painful.
Teach your people to merge baselines (branch to branch) or to cherry pick revisions ('svn merge -c') and you'll be fine.
> I did not understand everything with branches and tags, I have to read again the manual, but I have the feeling that branches and tags are not linked, this is strange to me.
A tag is a branch is a directory. Tags and branches aren't real objects in SVN. They're just directories that are treated as special by their human masters. Since tags are branches, it's common to use a pre-commit hook or auth file to limit write access to a tag. In practice, there's not a lot of difference between SVN checking in a change to a tag and CC moving a label to a new version on a file/dir.
>
IMHO, SVN's workspaces are light years ahead of CC's dynamic views and static workspaces in terms of ease of use. Tagging in SVN is effectively instantaneous. All of the cool stuff in CC that made for geeky CC admins isn't needed, meaning I haven't missed dynamic views, config specs, lazy branching, individual version trees, being able to cd into an element's version tree, having to merge dirs iteratively before merging files, etc., after converting to SVN. CC's slow history, slow labeling, latency issues, etc., aren't present in SVN. (However, to be fair, early versions of SVN were horrific (no merge tracking, no dir merges, etc.) but svn 1.7 is good enough outside of the --reintegrate issue.)
In other words, SVN's working paradigm is much simpler than CC's, and most of CC's super-special, gee-whiz features just aren't needed. In my experience/opinion, Subversion > ClearCase.
|
This is an archived mail posted to the Subversion Users mailing list.
This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.