This file is indexed.

/usr/share/gps/plug-ins/clearcase.py is in gnat-gps-common 6.1.1-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 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
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
"""
Provides support for the ClearCase configuration management system.

It integrates into GPS's VCS support, and uses the same menus as all other VCS
systems supported by GPS. You can easily edit this file if you would like to
customize the cleartool commands that are sent for each of the menus.
"""

import GPS

from vcs import *

actions = [
    SEPARATOR,

    {ACTION: "Status", LABEL: "Describe"},
    {ACTION: "Update", LABEL: "Update"},
    {ACTION: "Commit", LABEL: "Check in"},
    {ACTION: "Commit (via revision log)",
     LABEL: "Check in (via revision log)"},

    SEPARATOR,

    {ACTION: "Open",   LABEL: "Check out"},
    {ACTION: "History (as text)",
     LABEL: "View _entire revision history (as text)"},
    {ACTION: "History",
        LABEL: "View _entire revision history"},
    {ACTION: "History for revision",
        LABEL: "View specific revision _history"},

    SEPARATOR,

    {ACTION: "Diff against head",
        LABEL: "Compare against head revision"},
    {ACTION: "Diff against base",
        LABEL: "Compare against working revision"},
    {ACTION: "Diff against revision",
        LABEL: "Compare against specific revision"},
    {ACTION: "Diff between two revisions", LABEL: "Compare two revisions"},
    {ACTION: "Diff base against head",     LABEL: "Compare base against head"},

    SEPARATOR,

    {ACTION: "Annotate",                LABEL: "Annotations"},
    {ACTION: "Remove Annotate",         LABEL: "Remove annotations"},
    {ACTION: "Edit revision log",       LABEL: "Edit revision log"},
    {ACTION: "Edit global ChangeLog",   LABEL: "Edit global ChangeLog"},
    {ACTION: "Remove revision log",     LABEL: "Remove revision log"},

    SEPARATOR,

    {ACTION: "Add",               LABEL: "Add"},
    {ACTION: "Add (via revision log)",
     LABEL: "Add (via revision log)"},
    {ACTION: "Add no commit",     LABEL: "Add, no commit"},
    {ACTION: "Remove",            LABEL: "Remove"},
    {ACTION: "Remove (via revision log)",
     LABEL: "Remove (via revision log)"},
    {ACTION: "Remove no commit",  LABEL: "Remove, no commit"},
    {ACTION: "Revert",            LABEL: "Cancel checkout"},

    SEPARATOR,

    {ACTION: "Add directory, no commit",
        LABEL: "Directory/Add directory, no commit"},
    {ACTION: "Remove directory, no commit",
        LABEL: "Directory/Remove directory, no commit"},
    {ACTION: "Commit directory",
        LABEL: "Directory/Commit directory"},
    {ACTION: "Status dir",
        LABEL: "Directory/Query status for directory"},
    {ACTION: "Update dir",
        LABEL: "Directory/Update directory"},
    {ACTION: "Status dir (recursively)",     LABEL:
     "Directory/Query status for directory recursively"},
    {ACTION: "Update dir (recursively)",
     LABEL: "Directory/Update directory recursively"},

    {ACTION: "List project",
        LABEL: "Project/List files in project"},
    {ACTION: "Status project",
        LABEL: "Project/Query status for project"},
    {ACTION: "Update project",               LABEL: "Project/Update project"},
    {ACTION: "List project (recursively)",   LABEL:
     "Project/List files in project (recursively)"},
    {ACTION: "Status project (recursively)", LABEL:
     "Project/Query status for project (recursively)"},
    {ACTION: "Update project (recursively)",
     LABEL: "Project/Update project (recursively)"},
]

XML = r"""<?xml version="1.0" ?>
<ClearCase_support>
   <!-- ClearCase describe -->

   <action name="clearcase_describe" show-command="true" output="none" category="">
      <shell output="">echo "Describing $2-"</shell>
      <external>cleartool describe -fmt "%%En\n%%Xn\n%%f\n%%m %%Rf\n" $2-</external>
      <shell>VCS.status_parse "ClearCase Native" "%1" $1 FALSE</shell>
   </action>

   <!-- ClearCase annotate -->

   <action name="clearcase_annotate" show-command="true" output="none" category="">
      <shell output="">echo "Querying annotations for $1"</shell>
      <external>cleartool annotate -nheader -force -fmt "%%Sd\040%%-16.16u\040%%-40.39Vn:" -out - "$1"</external>
      <shell>VCS.annotations_parse "ClearCase Native" "$1" "%1"</shell>
   </action>

   <!-- ClearCase local status -->

   <action name="clearcase_local_status" show-command="true" output="none" category="">
      <external>cleartool ls -short $2-</external>
      <shell>VCS.status_parse "ClearCase Native" "%1" FALSE TRUE</shell>
   </action>

   <!-- ClearCase checkin -->

   <action name="clearcase_checkin" show-command="true" output="none" category="">
      <shell output="">echo "Checking in file(s) $2-"</shell>
      <shell>dump "$1" TRUE</shell>
      <external>cleartool ci -cfile "%1" $2-</external>
      <on-failure>
         <shell output="">echo_error "Clearcase error:"</shell>
         <shell output="">echo_error "%2"</shell>
         <shell>MDI.dialog "Clearcase: could not check-in file(s)."</shell>
      </on-failure>
      <shell>delete "%2"</shell>
   </action>

   <!-- ClearCase history -->


   <action name="clearcase_history" show-command="true" output="none" category="">
      <external>cleartool lshistory "$1"</external>
      <shell>dump "%1" TRUE</shell>
      <shell>Editor.edit "%1"</shell>
      <shell>MDI.split_vertically TRUE</shell>
      <shell>delete "%2"</shell>
   </action>

   <action name="clearcase_history_rev" show-command="true" output="none" category="">
      <external>cleartool lshistory "$2"</external>
      <shell>dump "%1" TRUE</shell>
      <shell>Editor.edit "%1" 1</shell>
      <shell>MDI.split_vertically TRUE</shell>
      <shell>File "%3"</shell>
      <shell>File.search_next %1 "$1"</shell>
      <shell>FileLocation.line %1</shell>
      <shell>Editor.edit "%6" %1</shell>
      <shell>delete "%7"</shell>
   </action>

   <!-- ClearCase update -->

   <action name="clearcase_update" show-command="true" output="none" category="">
      <external>cleartool update $*</external>
      <on-failure>
         <shell output="">echo_error "Clearcase error:"</shell>
         <shell output="">echo_error "%2"</shell>
         <shell>MDI.dialog "Clearcase: could not update file(s)."</shell>
      </on-failure>
      <shell>Hook "file_changed_on_disk"</shell>
      <shell>Hook.run %1 null</shell>
   </action>

   <!-- ClearCase diff -->

   <action name="clearcase_diff_patch" show-command="true" output="none" category="">
      <external>cleartool diff -diff_format  "${1}@@/main/LATEST" "$2"</external>

      <on-failure>
        <shell>dump_file "%1" "$1" FALSE</shell>
      </on-failure>
   </action>

   <action name="clearcase_diff_head" show-command="true" output="none" category="">
      <external>cleartool diff -diff_format  "${1}@@/main/LATEST" "$1"</external>

      <on-failure>
        <shell>base_name "$1"</shell>
        <shell>dump "%2" TRUE</shell>
        <shell>File %1</shell>
        <shell>File $1</shell>
        <shell>Hook "diff_action_hook"</shell>
        <shell>Hook.run %1 "$1" null %2 %3 "%5 [LATEST]"</shell>
        <shell>delete %5</shell>
      </on-failure>
      <shell output="">echo "No differences found."</shell>
   </action>

   <action name="clearcase_diff_working" show-command="true" output="none" category="">
      <external>cleartool diff -diff_format -predecessor "$1"</external>
      <on-failure>
        <shell>base_name "$1"</shell>
        <shell>dump "%2" TRUE</shell>
        <shell>File %1</shell>
        <shell>File $1</shell>
        <shell>Hook "diff_action_hook"</shell>
        <shell>Hook.run %1 "$1" null %2 %3 "%5 [WORKING]"</shell>
        <shell>delete %5</shell>
      </on-failure>
      <shell output="">echo "No differences found."</shell>
   </action>

   <action name="clearcase_diff" show-command="true" output="none" category="">
      <external>cleartool diff -diff_format "${2}@@${1}" "$2" </external>

      <on-failure>
        <shell>base_name "$2"</shell>
        <shell>dump "%2" TRUE</shell>
        <shell>File %1</shell>
        <shell>File $2</shell>
        <shell>Hook "diff_action_hook"</shell>
        <shell>Hook.run %1 "$2" null %2 %3 "%5 [$1]"</shell>
        <shell>delete "%5"</shell>
      </on-failure>
      <shell output="">echo "No differences found."</shell>
   </action>

   <!-- ClearCase checkout -->

   <action name="clearcase_checkout" show-command="true" output="none" category="">
      <shell>MDI.input_dialog "Checking out file(s)" "Comment:=GPS check-out"</shell>
      <external>cleartool co -c "%1" $*</external>
      <on-failure>
         <shell output="">echo_error "Clearcase error:"</shell>
         <shell output="">echo_error "%2"</shell>
         <shell>MDI.dialog "Clearcase: could not checkout file(s)."</shell>
      </on-failure>
      <shell>Hook "file_changed_on_disk"</shell>
      <shell>Hook.run %1 null</shell>
   </action>

   <!-- Clearcase uncheckout -->

   <action name="clearcase_uncheckout" show-command="true" output="none" category="">
      <external>cleartool uncheckout -keep $*</external>
      <on-failure>
         <shell output="">echo_error "Clearcase error:"</shell>
         <shell output="">echo_error "%2"</shell>
         <shell>MDI.dialog "Clearcase: could not uncheckout file(s)."</shell>
      </on-failure>
      <shell>Hook "file_changed_on_disk"</shell>
      <shell>Hook.run %1 null</shell>
   </action>

   <!-- ClearCase Add -->

   <action name="clearcase_add" show-command="true" output="" category="">
      <shell>dump "$1" TRUE</shell>
      <external>cleartool co -cfile "%1" .</external>
      <external>cleartool mkelem -cfile "%2" "$2"</external>
      <external>cleartool ci -cfile "%3" "$2"</external>
      <external>cleartool ci -cfile "%4" .</external>
      <shell>delete "%5"</shell>
   </action>

   <!-- ClearCase Add (no commit) -->

   <action name="clearcase_add_no_commit" show-command="true" output="" category="">
      <shell>dump "$1" TRUE</shell>
      <external>cleartool co -cfile "%1" .</external>
      <external>cleartool mkelem -cfile "%2" "$2"</external>
      <external>cleartool ci -cfile "%4" .</external>
      <shell>delete "%4"</shell>
   </action>

   <!-- ClearCase Remove -->

   <action name="clearcase_remove" show-command="true" output="" category="">
      <shell>dump "$1" TRUE</shell>
      <external>cleartool co -cfile "%1" .</external>
      <external>cleartool rm -cfile "%2" "$2"</external>
      <external>cleartool ci -cfile "%3" "$2"</external>
      <external>cleartool ci -cfile "%4" .</external>
      <shell>delete "%5"</shell>
   </action>

   <!-- ClearCase Remove (no commit) -->

   <action name="clearcase_remove_no_commit" show-command="true" output="" category="">
      <shell>dump "$1" TRUE</shell>
      <external>cleartool co -cfile "%1" .</external>
      <external>cleartool rm -cfile "%2" "$2"</external>
      <external>cleartool ci -cfile "%4" .</external>
      <shell>delete "%4"</shell>
   </action>

   <!-- ClearCase -->

   <vcs name="ClearCase Native" absolute_names="FALSE" category="">
      <status_files     action="clearcase_describe"         label="Describe"/>
      <local_status_files action="clearcase_local_status"   label="ls"/>
      <open             action="clearcase_checkout"         label="Check out"/>
      <update           action="clearcase_update"           label="Update"/>
      <commit           action="clearcase_checkin"          label="Check in"/>
      <history          action="clearcase_history"          label="View entire revision history"/>
      <history_revision action="clearcase_history_rev"      label="View specific revision history"/>
      <annotate         action="clearcase_annotate"         label="Annotations"/>
      <add              action="clearcase_add"              label="Add"/>
      <add_no_commit    action="clearcase_add_no_commit"    label="Add, no commit"/>
      <remove           action="clearcase_remove"           label="Remove"/>
      <remove_no_commit action="clearcase_remove_no_commit" label="Remove, no commit"/>
      <revert           action="clearcase_uncheckout"       label="Cancel checkout"/>
      <diff_patch       action="clearcase_diff_patch"       label="Compare against head revision for building a patch file"/>
      <diff_head        action="clearcase_diff_head"        label="Compare against latest"/>
      <diff_working     action="clearcase_diff_working"     label="Compare against working"/>
      <diff             action="clearcase_diff"             label="Compare against other rev."/>

      <status label="Not checked out" stock="gps-vcs-up-to-date" />
      <status label="Checked Out (Reserved)" stock="gps-vcs-modified" />
      <status label="Checked Out (Unreserved)" stock="gps-vcs-modified" />
      <status label="View-private File" stock="gps-vcs-not-registered" />

      <status_parser>
         <regexp>([^\n]*)\n(.*@@)?(.*)\n(.*)\n(.*)(\n|$)</regexp>

         <file_index>0</file_index>
         <status_index>5</status_index>
         <local_revision_index>3</local_revision_index>
         <repository_revision_index>4</repository_revision_index>

         <status_matcher label="Checked Out (Reserved)">version reserved</status_matcher>
         <status_matcher label="Checked Out (Unreserved)">version unreserved</status_matcher>
         <status_matcher label="Not checked out">version</status_matcher>
         <status_matcher label="View-private File">view private object</status_matcher>
      </status_parser>

      <local_status_parser>
         <regexp>([^@@]+)(@@)?([^\s]*)(\n|$)</regexp>

         <file_index>1</file_index>
         <local_revision_index>3</local_revision_index>
      </local_status_parser>

      <annotations_parser>
         <regexp>\d\d[^\\]*(\\[^\s]*)\s*(.*)(\n|$)</regexp>

         <repository_revision_index>1</repository_revision_index>
         <file_index>2</file_index>
      </annotations_parser>
   </vcs>
</ClearCase_support>
"""

GPS.parse_xml(XML)
register_vcs_actions("ClearCase Native", actions)