7

What is the difference between diff against basis and diff against backing in Accurev?

Otto
  • 18,761
  • 15
  • 56
  • 62

1 Answers1

20

I assume from your other posts in this forum that the context here would be in doing a diff of a file in your workspace against either Backed or Basis.

Diff against Basis is going to compare the file you currently have in your workspace with the version that you starting working with prior to making your changes. An example would be, you update your workspace, begin working on foo.c that is (backed) status, make several modifications to it and then run Diff against Basis. It will compare your modifications to the version you began with, regardless of what changes might now be in the parent stream. That is, it will show you only changes pertaining to your work.

Diff against Backed is going to compare the file you currently have in your workspace with the one that is currently in your backing - or parent -stream. Using the previous example, you have your modifications to foo.c but also another developer has promoted their own changes to foo.c into the parent stream since you began working. Running a Diff against Backed will compare your current file to the one in the parent stream, thus you will also be comparing against the other developer's changes, essentially viewing a pre-merge.

If no one else has made changes to foo.c, then Diff against Backed and Diff against Basis would yield the same result.

Lastly, for any given file, you can run History -> Browse Versions and diff any two versions that have ever existed if Backed or Basis isn't the specific compare you're looking for.

Hope this helps,
~James

jtalbott
  • 1,158
  • 6
  • 7
  • 2
    I believe what you've just said is that there's no way to view a given developer's changes to a file, after it's been promoted, if there are multiple sets of changes for that file. Diff against backed has no meaning in a parent, non-workspace stream, Diff against basis has everyone's changes. I call that fundamentally broken. :) Still, good answer. Thanks. – Otto Jan 21 '11 at 16:08
  • Hey Otto, I'd say you're correct, but only to a degree. Consider the context of any given stream; it is a dynamic configuration of code at a point in time. Backed will refer to how it differs from its parent stream. Which allows you to only promote "accepted" changes upstream, multi-stage integration if you will, and so the diff refers to the context against that parent stream. Out of necessity, we can only display a few options on the Diff menu; if you want to view a specific developer's changes, you can always use the Browse Versions window to select any version to diff... – jtalbott Jan 21 '11 at 19:34
  • I hear you, the limitation comes as a trade for other flexibility for release managers. But the problem is figuring out which versions to diff. You can do it in subversion with manually creating tags to mark starts and ends of branches, but I don't think that same mechanism can apply here as the start & end are determined by the parent streams. It doesn't help that I can't recursive diff a whole subfolder so I find myself guessing, validating my guess one file at a time and starting all over if I guessed wrong. – Otto Jan 21 '11 at 19:51
  • 1
    To be clear, I think the problem lies in the order of "promote" and "code review". We may need to "code review" then "promote" but I'm not seeing a clear way of setting that up, either. Also, we really don't want to hold up a developer while he waits for his changes to be reviewed and I think that's the end result without some new understanding of how things work. – Otto Jan 21 '11 at 19:52
  • Hmm, if it's code review at the heart of the matter, I believe you guys use Change Packages - linking the files to issue records. Every Change Package will know explicitly which head and basis to use for every file linked. You can open the Issue record and Diff against Basis to validate just the changes as they pertain to the issue, regardless of who submitted them. And you can do this anywhere, regardless of which stream the changes have been promoted to... – jtalbott Jan 21 '11 at 20:17