Merge branch 'maint-1.7.1' into maint-1.7.2
authorJunio C Hamano <gitster@pobox.com>
Wed, 16 Feb 2011 22:32:54 +0000 (14:32 -0800)
committerJunio C Hamano <gitster@pobox.com>
Wed, 16 Feb 2011 22:32:54 +0000 (14:32 -0800)
* maint-1.7.1:
fast-import: introduce "feature notes" command
fast-import: clarify documentation of "feature" command

1  2 
Documentation/git-fast-import.txt
fast-import.c
index 77a0a2481a34f987aab4688002a6e6a0ae2e497f,becee8b4e71859674495cff398a4de976f3f6a3b..072d4f9af242e69235c92c534e9fd53192002cca
@@@ -439,7 -439,7 +439,7 @@@ Marks must be declared (via `mark`) bef
  * A complete 40 byte or abbreviated commit SHA-1 in hex.
  
  * Any valid Git SHA-1 expression that resolves to a commit.  See
 -  ``SPECIFYING REVISIONS'' in linkgit:git-rev-parse[1] for details.
 +  ``SPECIFYING REVISIONS'' in linkgit:gitrevisions[1] for details.
  
  The special case of restarting an incremental import from the
  current branch value should be written as:
@@@ -878,28 -878,31 +878,31 @@@ Require that fast-import supports the s
  it does not.
  
  ....
-       'feature' SP <feature> LF
- ....
- The <feature> part of the command may be any string matching
- ^[a-zA-Z][a-zA-Z-]*$ and should be understood by fast-import.
- Feature work identical as their option counterparts with the
- exception of the import-marks feature, see below.
- The following features are currently supported:
- * date-format
- * import-marks
- * export-marks
- * relative-marks
- * no-relative-marks
- * force
- The import-marks behaves differently from when it is specified as
- commandline option in that only one "feature import-marks" is allowed
- per stream. Also, any --import-marks= specified on the commandline
- will override those from the stream (if any).
+       'feature' SP <feature> ('=' <argument>)? LF
+ ....
+ The <feature> part of the command may be any one of the following:
+ date-format::
+ export-marks::
+ relative-marks::
+ no-relative-marks::
+ force::
+       Act as though the corresponding command-line option with
+       a leading '--' was passed on the command line
+       (see OPTIONS, above).
+ import-marks::
+       Like --import-marks except in two respects: first, only one
+       "feature import-marks" command is allowed per stream;
+       second, an --import-marks= command-line option overrides
+       any "feature import-marks" command in the stream.
+ notes::
+       Require that the backend support the 'notemodify' (N)
+       subcommand to the 'commit' command.
+       Versions of fast-import not supporting notes will exit
+       with a message indicating so.
  
  `option`
  ~~~~~~~~
diff --combined fast-import.c
index ddad289dae37c2115f57f88dc207f0d2fa6ab1f3,bce460e2edc1ae7331e2b25523794d834b970c26..86687f391048dbca3920bbc1b47941118c5059da
@@@ -267,7 -267,7 +267,7 @@@ struct hash_lis
  typedef enum {
        WHENSPEC_RAW = 1,
        WHENSPEC_RFC2822,
 -      WHENSPEC_NOW,
 +      WHENSPEC_NOW
  } whenspec_type;
  
  struct recent_command
@@@ -1666,7 -1666,7 +1666,7 @@@ static void dump_marks_helper(FILE *f
        if (m->shift) {
                for (k = 0; k < 1024; k++) {
                        if (m->data.sets[k])
 -                              dump_marks_helper(f, (base + k) << m->shift,
 +                              dump_marks_helper(f, base + (k << m->shift),
                                        m->data.sets[k]);
                }
        } else {
@@@ -2707,7 -2707,6 +2707,7 @@@ static void option_import_marks(const c
        }
  
        import_marks_file = make_fast_import_path(marks);
 +      safe_create_leading_directories_const(import_marks_file);
        import_marks_file_from_stream = from_stream;
  }
  
@@@ -2738,7 -2737,6 +2738,7 @@@ static void option_active_branches(cons
  static void option_export_marks(const char *marks)
  {
        export_marks_file = make_fast_import_path(marks);
 +      safe_create_leading_directories_const(export_marks_file);
  }
  
  static void option_export_pack_edges(const char *edges)
@@@ -2800,6 -2798,8 +2800,8 @@@ static int parse_one_feature(const cha
                relative_marks_paths = 0;
        } else if (!prefixcmp(feature, "force")) {
                force_update = 1;
+       } else if (!strcmp(feature, "notes")) {
+               ; /* do nothing; we have the feature */
        } else {
                return 0;
        }