With a trunk and a branch, on a project, shouldn't the revision log show the same contents for a specific file's revision number (e.g. 123), regardless of whether it was viewed on the branch or trunk?
I'm looking at the file revision 123 via both the trunk and branch log and the contents are definitely different. I have been messing around with merges, but how would this affect historic files?
I'm totally baffled by this as I would expect them to be identical.
If you are looking at a the repository via a specific revision number, you see the state of that directory at the specific revision(*). This means that say the branch was created at revision 99; if a file was modified at revision 100 in the branch, and revision 101 in the trunk you will see different contents for the file in the two directories.
(*) same for the HEAD revision, although the number is implicit in that case (resolving to the latest revision number available)
With a trunk and a branch, on a project, shouldn't the revision log show the same contents for a specific file's revision number (e.g. 123), regardless of whether it was viewed on the branch or trunk?
Not if it's a revision after the branch was created.
Related
Im trying to get incremental inline diff working in Sublime text 3, but Show Diff Hunk is greyed out and not working. I'm in a branch trying to diff branch to master, for reference. I've set the setting at root level:
"git_diff_target":"master"
But its not working. Anyone know what I need to do to get this working?
This particular setting and feature don't work the way you think they do as far as the core is concerned (but see below).
The Incremental Diff feature that's core to the editor tracks changes to your file as you make them, based on either the state of the file as it exists on disk (for files not tracked by git) or, for files tracked by git, against the version of the file in the index or at the HEAD of the repository; it does not calculate deltas based on arbitrary branches.
In particular, the setting in question is:
// This setting determines whether tracked Git files should be diffed
// against the index or HEAD.
// Valid values are "index" or "head"
"git_diff_target": "index",
So your options are either to compare against the version of the file that you checked out originally to see what you changed, or the version of the file that you checked out to see what you changed, but anything you've staged for commit is not marked as different so you can work with changes that are still pending.
To get the functionality that you're after here, you need a package that alters the default functionality; an example of that is GitGutter, which has amongst its package settings a compare_against setting:
GitGutter compares the content of the view against the HEAD of the checked out branch by default. To change this default behaviour the compare_against setting can be changed to any tag, branch or commit hash git understands.
If I obliterate a changelist or a file revision will I still be able to sync later revisions?
I ask because perforce shows diff against the previous revision and if that gets obliterated will the later revisions come?
eg% p4 describe 400648
Differences ...
==== //releases/version.xml#135 (text) ====
4c4
< <build build="71">
---
> <build build="72">
So if I obliterate #134 or the changelist containing it, will I be able to sync #135 and later revisions ?
Yes, you will be able to sync later versions. The p4 obliterate page http://www.perforce.com/perforce/doc.current/manuals/cmdref/obliterate.html says it will only obliterate the version(s) you specify:
If you specify a single revision (for instance, p4 obliterate file#3),
only that revision of the file is obliterated. If you specify a
revision range (for instance, p4 obliterate file#3,5), only the
revisions in that range are obliterated.
This example from the same page shows that obliterated versions will no longer exist to Perforce, but later versions will:
Obliterating files in revision ranges can also change the behavior of
scripts, as revision numbers of files may "skip" obliterated
revisions. For instance, the output of p4 filelog after obliterating
revisions #2 and #3 might look like this:
... #4 change 1276 edit on 2011/04/18 by user#dev1 (binary) 'Fixed'
... #1 change 1231 add on 2011/04/12 by user#dev1 (binary) 'First try'
When looking at perforce depot in P4V, an xml file would be read some_file.xml #3/3 <text>. What does this #3/3 mean?
I have files that are #0/1, and do not end up in my workspace when I sync. Scrolling over it gives "not synced in your workspace". Are these related?
The number to the left of the slash is the revision of that file that you have in your workspace, the number to the right of the slash is the number of revisions of that file that exist on the Perforce server. If you see some_file.xml #n/n <text> you have the latest revision of that file (the numbers match).
If you see a zero on the left side of the slash (e.g., some_file.xml #0/n <text>), that means the file exists in version control, but it does not exist in your workspace.
If the number on the left is anything between 0 and n, you have some previous revision of the file. P4V will indicate this with a yellow triangle.
#3/3 means you have version 3 and the maximum version available is 3
#0/1 means you have code that is not committed to your workspace (I don't think the 1 has any significance other than adding this version will produce version 1).
Looking at the documentation, I think more generally the meaning is "yours/theirs". In this case, I would see #0/1 as meaning you don't have a version locally, but there is a version available. Therefore if you sync, you'll get the version locally and hence has #1/1.
we cut branch from Trunk. Changes are done on both trees and committed. Now we want to merge branch to trunk with all the revision history from both. Is it possible?
Is manual merge is different from tortoise SVN merge say i have to do 3-4 files?
"Means i manually check the changes then do it on trunk and commit the trunk."
I earlier put a question regarding it but still confused.
Experts comment only.
Thx
You should be able to merge from your branch to trunk by simply right clicking on the target branch and selecting merge. Typically, a reintegrate merge will merge all changes from a branch back into the target branch. I have had failures with that in the past based on the version of svn, how merges have been done in the past, etc. At that point, I simply would do a 'Merge revision range' without specifying a revision. It then picked up the appropriate ranges to merge and successfully pulled those over to trunk.
Once the merge is done, you must commit the merges. Simply put, the merge operation completes on your local working copy. You will then have to commit the changes to your working copy in order for others to pick it up. I recommend doing merges on clean copies of branches/targets (meaning you have no outstanding changes on either branch). Also, make sure you commit any property changes as well.
Lastly, if you just want to merge a specific change, you can specify the revision in which the change was made instead of doing a full merge/reintegration.
I'm using TortoiseSVN without an external Subversion server to manage LabView source (i.e. a large collection of ever-changing binary files).
I'd like to have a "beta" branch of the repository that anyone can subscribe to and get daily updates. I guess this is different from a usual beta release series with separate branches, but it's right for this project.
What is the best/easiest way to copy the contents of a particular revision of the trunk branch over to the beta branch? Essentially what I want to do is delete the old contents of beta and insert new contents. Delete+add would work, I suppose, but it's clearly suboptimal. Merge is not an option unless I can get Tortoise to automatically resolve all conflicts in the trunk's favor, including deleting files.
Update: a couple people have asked why I don't want delete+add. I'd like a cleaner alternative.
This method leads to half the updates to the beta tree being "wipe out last rev."
The updates are not atomic so someone could pick up an empty release.
I haven't tried and seen, but beta wouldn't be a proper branch. Would the revision log even track multiple revisions at all, since it's a "new" file each time?
Update 2: svn allows any arbitrary commands before a commit, but I couldn't get Tortoise to work this way. After selecting "Delete," stub directories were still left over until I committed, at which point I could repopulate the branch. There needs to be a way to unmark a directory for deletion when it exists in both the old and new tag revisions.
Merge is not an option unless I can
get Tortoise to automatically resolve
all conflicts in the trunk's favor,
including deleting files.
I don't know about TortoiseSVN, but if you install the command line client you could do the following to merge the latest trunk changes to a beta branch:
cd c:/path/to/my/working/copy/of/beta/branch
svn merge file:///c:/path/to/my/repository/trunk --accept theirs-full
svn commit -m "merged latest trunk changes to beta branch"
The --accept theirs-full option resolves all conflicts by using the trunk's version like you want.
This has some advantages: subversion will do representation sharing, so files stored on both branches will not take extra space in the repository. Also, when users update their beta working copy, only the files that were changed need to be pulled over the wire.
SVN is transactional - a delete and copy (not add!) would not be problematic. And beta would be a proper branch (or better a tag)
Why not delete beta/* and then copy trunk/* to beta/ ?