Diff
Not logged in

Differences From Artifact [5f135a287c]:

To Artifact [bc66657345]:


31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55

56

57

58
59

60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
31
32
33
34
35
36
37

38
39
40

41
42

43
44
45





46

47
48
49

50
51

52
53









54
55
56
57
58
59
60







-



-


-



-
-
-
-
-

-
+

+
-
+

-
+

-
-
-
-
-
-
-
-
-







** will never push and hence will not be shared with collaborators.
**
** By default, this command only shows unpublished checkins.  To show
** all unpublished artifacts, use the --all command-line option.
**
** OPTIONS:
**     --all                   Show all artifacts, not just checkins
**     --brief                 Show just the SHA1 hashes, not details
*/
void unpublished_cmd(void){
  int bAll = find_option("all",0,0)!=0;
  int bBrief = find_option("brief",0,0)!=0;
  const char *zCols;
  int n = 0;
  Stmt q;

  db_find_and_open_repository(0,0);
  verify_all_options();
  if( bBrief ){
    zCols = "(SELECT uuid FROM blob WHERE rid=private.rid)";
  }else{
    zCols = "private.rid";
  }
  if( bAll ){
    db_prepare(&q, "SELECT %s FROM private", zCols/*safe-for-%s*/);
    describe_artifacts_to_stdout("IN private", 0);
  }else{
    describe_artifacts_to_stdout(
    db_prepare(&q, "SELECT %s FROM private, event"
      "IN (SELECT rid FROM private CROSS JOIN event"
                   " WHERE private.rid=event.objid"
                   "   AND event.type='ci';", zCols/*safe-for-%s*/);
                   "   AND event.type='ci')", 0);
  }
  while( db_step(&q)==SQLITE_ROW ){
    if( bBrief ){
      fossil_print("%s\n", db_column_text(&q,0));
    }else{
      if( n++ > 0 ) fossil_print("%.78c\n",'-');
      whatis_rid(db_column_int(&q,0),0);
    }
  }
  db_finalize(&q);
}

/*
** COMMAND: publish
**
** Usage: %fossil publish ?--only? TAGS...
**
115
116
117
118
119
120
121
122

123
124
125
126
127
128
129


130
131
132
133
134
135
136
137
138
139
140
141
142
143
99
100
101
102
103
104
105

106







107
108


109
110
111
112
113
114
115
116
117
118
119
120







-
+
-
-
-
-
-
-
-
+
+
-
-












    find_checkin_associates("ok", bExclusive);
  }
  if( bTest ){
    /* If the --test option is used, then do not actually publish any
    ** artifacts.  Instead, just list the artifact information on standard
    ** output.  The --test option is useful for verifying correct operation
    ** of the logic that figures out which artifacts to publish, such as
    ** the find_checkin_associates() routine */
    ** the find_checkin_associates() routine 
    Stmt q;
    int i = 0;
    db_prepare(&q, "SELECT rid FROM ok");
    while( db_step(&q)==SQLITE_ROW ){
      int rid = db_column_int(&q,0);
      if( i++ > 0 ) fossil_print("%.78c\n", '-');
      whatis_rid(rid, 0);
    */
    describe_artifacts_to_stdout("IN ok", 0);
    }
    db_finalize(&q);
  }else{
    /* Standard behavior is simply to remove the published documents from
    ** the PRIVATE table */
    db_multi_exec(
      "DELETE FROM ok WHERE rid NOT IN private;"
      "DELETE FROM private WHERE rid IN ok;"
      "INSERT OR IGNORE INTO unsent SELECT rid FROM ok;"
      "INSERT OR IGNORE INTO unclustered SELECT rid FROM ok;"
    );
  }
  db_end_transaction(0);
}