3

The man page seems simple enough:

accurev diff -- -p

however I haven't "kept" anything and I absolutely do not want to keep anything. I want a patch file that expresses the changes I've edited into the code. Nope. Apparently you have to keep it first. I guess I need another workspace and diff the files one by one? Please tell me AccuRev is not that brain damaged! :( Thank you!

That's what I'll do for today, but I hope there is a better answer.

Bruce K
  • 749
  • 5
  • 15
  • Your question if not very clear. Are you looking to perform a patch operation or diff operation? – jstanley Mar 06 '14 at 17:28
  • Yes, both diff and patch, but using "patch(1)". Doing this after I've "adjusted" the diff output (patch file). So, how do I get a diff (patch file) based on my non-kept edits? The obvious "accurev diff" does not work. – Bruce K Mar 06 '14 at 17:58
  • If you are just modifying the file and not performing any keeps, you are limited to the diff operations in your workspace. Diffing against your most recent changes. Diffing against your basis version and Diffing against the backed versions. If you perform keeps along your development progress, you can diff iterations you made to the file. Answering the question...What's the difference between the work I did yesterday and today? By just saving the file, you lose this functionality. Also, by doing keeps, you can easily patch in those iterations. – jstanley Mar 06 '14 at 18:29
  • Well, I'm new to AccuRev and have been using SCM for 40 years. I am used to using command line tools to do many things. AccuRev seems to try to coerce me into using the GUI, which I find exceedingly clunky. So I was wanting to use familiar tools. I'm sorry you found the question stupid or ill-informed. It is the latter, or I'd have not been asking a question at all. BTW, the GUI is based on CLI tools and the GUI does let you see diffs between the in-the-workspace version and the backed version, so there must be a CLI tool to do what I want. It is just obscure to me. – Bruce K Mar 06 '14 at 19:41
  • Any operation you perform in the GUI, you can also do via the CLI. If you wish to see the difference between your workspace version and backing stream, run the command 'accurev diff -b '. – jstanley Mar 06 '14 at 20:53
  • Thank you. In other words, you must a priori know which files you want to diff and iterate over those files. If you want a patch file, that is. Again, I know there is some way to figure out what has been edited and what those edits are. The GUI does this some how or another. The easy way is to use the GUI and get separate listings for each changed file. Except I want to process the entire patch file with various tools, so the GUI is useless. I guess that is not the way AccuRev is expected to be used and I am supposed to use it the AccuRev way. *sigh*. – Bruce K Mar 06 '14 at 21:48

1 Answers1

7
list=$(accurev stat -m | awk '{print $1}')
for f in $list ; do
   accurev diff -b ${f#./} -- -p
done > patch-file

Too hard. Too non-obvious.

Bruce K
  • 749
  • 5
  • 15
  • Did you try: accurev diff -- -m ? accurev help diff says: -m Select only elements that have been modified in your workspace. May not be used with -k. – Radu C Jan 20 '17 at 15:52