title: Gulp-rev-all is creating new files on each run
body: <p>I've got a problem with <code>gulp-rev-all</code>. I have the following basic gulpfile:</p>
  
  <pre><code>var gulp = require('gulp'),
      RevAll = require('gulp-rev-all'),
      autoPrefixer = require('gulp-autoprefixer'),
      rename = require('gulp-rename'),
      sass = require('gulp-sass'),
      sourceMaps = require('gulp-sourcemaps');
  
  gulp.task('sass', function () {
    var stream = gulp.src('./app/assets/stylesheets/application.scss')
      .pipe(sourceMaps.init())
      .pipe(sass({errLogToConsole: true}))
      .pipe(autoPrefixer())
      .pipe(rename("application.css"))
      .pipe(sourceMaps.write("."))
      .pipe(gulp.dest("./public/assets/stylesheets/"))
  });
  
  gulp.task('production', function() {
    gulp.src('./public/*assets/**')
      .pipe(RevAll.revision())
      .pipe(gulp.dest('./public'))
      .pipe(RevAll.versionFile())
      .pipe(gulp.dest('./app/assets'));
  });
  
  gulp.task('default', ['sass', 'production']);
  </code></pre>
  
  <h2>Expectation vs. reality</h2>
  
  <p>When I run gulp, it bombs out with the following error:</p>
  
  <pre><code>Error: revision() must be called first!
  </code></pre>
  
  <p>But when I remove the production task and run the following then the sass task finishes as usual:</p>
  
  <pre><code>gulp.task('default', ['sass']);
  </code></pre>
  
  <p>After this task has created the files, changing the default task back to include the production task will successfully finish and create a fingerprinted CSS file.</p>
  
  <p>When I run gulp again it does something strange:</p>
  
  <ol>
  <li><p>First gulp task (without proudction task) creates: </p>
  
  <p>application.css <code>(this task is idempotent)</code></p></li>
  <li><p>Then I run the gulp task with production for the first time. The folder now looks like:</p>
  
  <p>application.css</p>
  
  <p>application.4434fcd5.css</p></li>
  <li><p>Then I run it again and now the folder looks like:</p>
  
  <p>application.css</p>
  
  <p>application.4434fcd5.css</p>
  
  <p>application.4434fcd5.4434fcd5.css</p></li>
  </ol>
  
  <h2>The problem</h2>
  
  <p>I think both problems stem from something in the production task creating some sort of look up issue. What is it?</p>